MP2 - Source code for TvEngine3? (currently only available as package)

Discussion in 'Plugin Development' started by Tuggax, June 16, 2017.

Tags:
  1. Tuggax

    Tuggax Portal Member

    Joined:
    June 16, 2017
    Messages:
    5
    Likes Received:
    3
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    I very recently downloaded the source code for MP2 and wanted to experiment and tweak the recording logic (i.e. change how the different "ScheduleRecordingType(s)" work) on my home setup.

    Unfortunately, in MP2 the tv engine is only available as a package (MediaPortal\Packages\MediaPortal.TvEngine.Core3.3.0.16.2\lib) so I'm unable to perform my tweaks.



    Is the code for this package publicly available and if so how can I download it?

    Thanks in advance!
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    10,856
    Likes Received:
    4,680
    Ratings:
    +6,704 / 11
    Home Country:
    Germany Germany
    Show System Specs
  4. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    10,856
    Likes Received:
    4,680
    Ratings:
    +6,704 / 11
    Home Country:
    Germany Germany
    Show System Specs
    @Tuggax did you come further with my information?

    I'm curious to know you intentions, what do you plan to change? Did you create an own fork yet for development?
     
    • Agree Agree x 1
  5. Tuggax

    Tuggax Portal Member

    Joined:
    June 16, 2017
    Messages:
    5
    Likes Received:
    3
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    Thank you @morpheus_xx for your earlier reply, your link was exactly what I was trying to get.

    I initially just took a copy of the source code to see it I could get it compiling and after some trial and error I was up and running.

    Firstly, a brief description of the problem I'm trying to solve:

    In Australia (where I live) the TV guide is lacking important information and TV shows are constantly changing their airing time week-to-week.

    The main problem with the TV guide and program scheduling is as follows:

    1) The TV guide doesn't contain series or episode information (so I can't filter out duplicates).

    2) Popular (i.e. reality TV and nightly current affair) shows often air at night time and than again around lunchtime the following day.

    3) The shows that repeat at lunchtime have the exact same title as the original

    4) Reality shows will often air at 19:00 on weekdays and 19:30 on Sunday nights (and once eliminations start will air only Sun & Mon etc)​

    As a result I either forced to use the "Record Every Time" schedules and get stuck with multiple repeats or alternatively I have to manually (on a weekly basis) set up recordings to account for time shifts in air time.

    My solution:

    For the three schedules types (EveryTimeOnThisChannel, EveryTimeOnEveryChannel, WeeklyEveryTimeOnThisChannel) that record on title (and not time) I have implemented an optional "recording time window" for the schedule.

    Note, this was an option I used in MCE all the time (before I switched to Windows 10 & MP2).

    When enabled, only shows that match with the title and additionally fall within this "recording time window" are recorded. It's still work in progress but so far is working exactly as I had hoped and even shows the filtered list correctly in both MP and Kodi GUIs.

    As an example, I've created a EveryTimeOnThisChannel schedule to record "The Voice" at 19:30 and have a 4 hr recording window (2 hours before/after the start time). This now successfully avoids recording the lunchtime airings and at the same time is also recording the Sunday 19:00 show.

    Lastly, today I created myself a GitHub account, forked your code and clone to my hard drive.

    Hopefully will find some time soon to checkin my changes (made so far) and to see if this is of interest to the MP2 community.

    Cheers!
     
    • Thank You! Thank You! x 2
    • Agree Agree x 1
  6. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,453
    Likes Received:
    1,103
    Gender:
    Male
    Ratings:
    +2,366 / 21
    Home Country:
    Germany Germany
    Show System Specs
    Definitely :)
     
    • Agree Agree x 1
  7. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    5,978
    Likes Received:
    1,469
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,232 / 2
    Home Country:
    Germany Germany
    Is this not, what @Brownard has just implemented 1-2 weeks before? (But not visible for public),
     
    • Agree Agree x 1
  8. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    10,453
    Likes Received:
    1,103
    Gender:
    Male
    Ratings:
    +2,366 / 21
    Home Country:
    Germany Germany
    Show System Specs
    @Brownard's work added manual schedules to record a certain time window independently of the guide content. This allows recording even if there is no guide content at all, but it won't record any specific show only.

    @Tuggax is adding functionality to record a given show - guide content required! - within a predefined time window. It would be interesting to see this in practice to better assess the behavior.

    The test builds are accessible, aren't they? So @Tuggax could also use the latest WiP 2.1.1 version.

    @Tuggax , in the end you are doing something that under MP1 can be achieved with the Plugin TvWishList. It might be worthwhile to look at the description of it in the MP1 section to understand what it does. Among others you can define shows that you won't to be automatically scheduled, based on title, channel, time, format, and much more. It also allows the use of RegEx definitions, hence its scope is pretty unlimited.

    There had been some work to port it to MP2 but it stalled and currently nobody is working on it. We would more than appreciate if you managed to bring this back on stream.
     
    • Like Like x 1
  9. Tuggax

    Tuggax Portal Member

    Joined:
    June 16, 2017
    Messages:
    5
    Likes Received:
    3
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    @HTPCSourcer, thanks for the information.

    I'll try and have a look into TvWishList when I get the chance.

    In the meantime, I checked in my WIP changes into my fork:

    GitHub - Tuggax/MediaPortal-1: MediaPortal turns your HTPC into a very advanced media center, or Home Theater PC (HTPC)

    At this early stage I've updated the TvEngine to only record matching titles that fall inside a 4 hour window (2 hrs either side of the schedule's startTime).

    The 4 hour window is currently hard coded so further development is required and would include:

    1) Having the window time setting (currently defined as minute offset from start time - 120 mins [2hrs]) saved in the database (i.e. New column in the schedule table with a default of 0. A zero value indicates there is no offset defined and it would record all shows regardless of time)

    2) Update the schedule interfaces to allow this property to be set and updated

    3) Update MP2 and Kodi GUIs to allow this option to be set
     
  10. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    10,856
    Likes Received:
    4,680
    Ratings:
    +6,704 / 11
    Home Country:
    Germany Germany
    Show System Specs
    One question to the logic:
    I think it would be better to have an option to use this filtering or not. Personally I record all airings of episodes, because there are less ads in repeated airings at night. So adding the filter generally would break this.

    I also recommend a look at TVWhishList, its a plugin and would not require changes to the core logic.
     
  11. Tuggax

    Tuggax Portal Member

    Joined:
    June 16, 2017
    Messages:
    5
    Likes Received:
    3
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    To clarify, in production code (i.e. code checked into the main dev branch) the default setting would be 0 which would NOT perform any filtering and leave the functionality exactly how it is in the current release (Record ALL matching titles).

    Likewise, GUIs would need to be updated to include an extra DropDownList option with the default setting set to record All Shows (i.e. setting the property to 0 and thus no filtering)

    An example of the DropDownList option:

    Shows to record => [All Shows], [30 mins either side of Start Time], [60 mins either side of Start Time], [90 mins either side of Start Time], [120 mins either side of Start Time]

    And just to be clear, [All Shows] == 0 in the code.

    However, in my fork, for test purposes only I currently have it hard coded to 120 mins either side of the start time and in my home (kodi front end) setup and it works just great (if I do say so myself ;-)

    Does that make more sense?
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!