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

Tuggax

Portal Member
June 16, 2017
5
9
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!
 

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    @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?
     

    Tuggax

    Portal Member
    June 16, 2017
    5
    9
    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!
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    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.
    Is this not, what @Brownard has just implemented 1-2 weeks before? (But not visible for public),
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Is this not, what @Brownard has just implemented 1-2 weeks before?
    @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.

    But not visible for public
    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.
     

    Tuggax

    Portal Member
    June 16, 2017
    5
    9
    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
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    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.
     

    Tuggax

    Portal Member
    June 16, 2017
    5
    9
    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?
     

    Users who are viewing this thread

    Top Bottom