Improved Weekly / Daily recording algorithm

Discussion in 'Improvement Suggestions' started by dvdfreak, March 13, 2007.

  1. dvdfreak

    dvdfreak Portal Pro

    Joined:
    June 13, 2006
    Messages:
    979
    Likes Received:
    178
    Ratings:
    +178 / 0
    Home Country:
    Belgium Belgium
    Hey all,

    A while back I made a quick "fix" to MediaPortal 0.2 to change the algorithm behind Weekly (and Daily) schedules.

    Like MP works out of the box is very simple: record every week from 22:00 until 23:00, whatever the program at that time. The way I modified it is also simple, but IMHO more useful: record program FOO every week "around" the same start-time.

    So if program FOO is no longer broadcast nothing will be recorded. If program FOO starts 10 minutes earlier or later next week, it will still be recorded. If program FOO happens to be a 2-hour special next week, it will still be (completely) recorded.



    I've been running with my little patch for a while now and could not do without it again :)

    This algorithm is very easy to implement and I'd be happy to do this for TVE3. But before I did so I wanted to throw this into the group: what is the general feedback on this? It would be great if the patch could be applied to the main code base.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. gemx
    • Premium Supporter

    gemx Retired Team Member

    Joined:
    October 31, 2006
    Messages:
    1,972
    Likes Received:
    541
    Ratings:
    +541 / 0
    Home Country:
    Germany Germany
    Show System Specs
    I like the idea and find it very useful :)
     
  4. The_Stig
    • Premium Supporter

    The_Stig Retired Team Member

    Joined:
    April 5, 2005
    Messages:
    2,176
    Likes Received:
    288
    Ratings:
    +426 / 5
    Hi dvdfreak,

    thats what have been asked several times (from me and others).

    I want to draw your attention to the following threads: https://forum.team-mediaportal.com/implementing_personal_epg-t12619.html?t=12619
    https://forum.team-mediaportal.com/fuzzy_recording-t15798.html?t=15798

    Maybe you could match up with bavarian, because I think he has great ideas but not too much time. So it would be great if you jump on IRC and talk to the Coders there...thats most likely the easiest and fastest way to get it integrated.

    Regards,

    Paloema
     
  5. rtv
    • Premium Supporter

    rtv Retired Team Member

    Joined:
    April 7, 2005
    Messages:
    3,622
    Likes Received:
    301
    Occupation:
    CTO at ES2000
    Location:
    Osnabruck
    Ratings:
    +301 / 0
    Home Country:
    Germany Germany
    Show System Specs
    There are looots of other issues to consider - even if it might work well for you.

    A decent timeslot schedule should also be able to do weighted string comparison:
    E.g. title matching must include
    1. Tuning TV
    2. Tuning tv
    3. Tuning Tv
    4. TuningTV
    5. ...

    Some EPG sources even suffer from more difficult problems like adding the episode or part number.
    1. Simpsons (28)
    2. Simpsons (29)
    3. ...

    I guess someone might already have coded a function that takes 2 strings and returns a percentage of similiarity (only one changed case or whitespace might be 99% identical, a changed letter at the same place 98%, etc). We would be very interested in getting something like this...
     
  6. gemx
    • Premium Supporter

    gemx Retired Team Member

    Joined:
    October 31, 2006
    Messages:
    1,972
    Likes Received:
    541
    Ratings:
    +541 / 0
    Home Country:
    Germany Germany
    Show System Specs
    rtv is right.
    Had the same problem a while ago.
    I remebered that it is called the "Levenstein algorithm".
    A quick search on codeproject.com showed up the following article.
    http://www.codeproject.com/cs/algorithms/Levenshtein.asp
    Should be easy to implement since the example is already C# :)
     
  7. Smirnuff

    Smirnuff Portal Pro

    Joined:
    December 7, 2004
    Messages:
    630
    Likes Received:
    3
    Occupation:
    Software Developer
    Location:
    United Kingdom
    Ratings:
    +3 / 0
    There's already a Levenstein class in the codebase. It was added to improve IMDB title matching.

    I figure its also worth mentioning this document, there is an open-source Java implementation that ports easily to C#. I've used it in the past and found that it allows for very sophisticated schedules with very little effort.
     
  8. dvdfreak

    dvdfreak Portal Pro

    Joined:
    June 13, 2006
    Messages:
    979
    Likes Received:
    178
    Ratings:
    +178 / 0
    Home Country:
    Belgium Belgium
    I'd be happy (time permitting) to add this to the scheduler.

    And indeed the Levenstein algorithm seems a very nice addition to what I suggested in my first post.

    There's also a small issue of what is considered the same time slot. In TVE2 I coded the margin as the program length minus 1 minute, so in most cases a 22:00-23:00 slot would result in a virtual start-slot of 21:01 until 22:59. If the program with the same (or we improve this to "similar enough") title starts anywhere in that region of time, it is recorded.

    In any case, heaps more useful than what is possible now :)
     
  9. The_Stig
    • Premium Supporter

    The_Stig Retired Team Member

    Joined:
    April 5, 2005
    Messages:
    2,176
    Likes Received:
    288
    Ratings:
    +426 / 5
    Yeah, that would solve most problems with your margin. Maybe (from a non-coders-view) it is possible to set up timeslots. That would be most flexible then, like

    Record everytime when starttime is between 8 and 11 pm.

    But that has all been discussed in the threads I linked in my post above...(which are working now :-| )

    Regards,

    Paloema
     
  10. dvdfreak

    dvdfreak Portal Pro

    Joined:
    June 13, 2006
    Messages:
    979
    Likes Received:
    178
    Ratings:
    +178 / 0
    Home Country:
    Belgium Belgium
    You can take this far, but the most ideal implementation would be to keep it simple I think. Simply let the user select "Weekly", with no additional configuration on his part.

    I think we can get this right for 99% of all cases, and it will definately be an improvement over the current situation :)
     
  11. The_Stig
    • Premium Supporter

    The_Stig Retired Team Member

    Joined:
    April 5, 2005
    Messages:
    2,176
    Likes Received:
    288
    Ratings:
    +426 / 5
    Agreed!
     
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!