For The Record - The rule-based scheduling suite (2 Viewers)

dvdfreak

Portal Pro
June 13, 2006
979
178
Home Country
Belgium Belgium
Drumroll...

TV Scheduler is dead, long live...



I will not overload the forum here with posting screenshots or listing features, everything is on the new site (For The Record).

The only thing worth mentioning is that an upgrade from TV Scheduler 1.0.15.0 to For The Record 1.1.0.0 should go automatically for SQL Express users (the database will be transformed automatically). If you are a MySQL user you can backup your "TvScheduler" database and restore it as "ForTheRecord" before running the For The Record setup. The only important thing is to make sure you uninstall TV Scheduler before installing For The Record.

May I invite you all to take the red pill and join us on the other side? :D

[size=+1]TV Scheduler Web Access[/size]

WebLogon.pngWebGuide.pngWebGuidePopup.pngWebGuidePopup2.pngWebUpcoming.png
WebUpcomingPopup.pngWebSchedules.pngWebEditSchedule.png

[size=+1]TV Scheduler Management Console[/size]

TvGuide.PNGSearchTvGuide.pngEditSchedule.PNGEditManualSchedule.PNGRecordings.PNG
UpcomingRecordings.PNGSettings.PNG]ChannelGroups.PNG]Channels.PNG

TVE3 Plugin Update (March 25th, 2008)

I recompiled the TVE3 plugin against the assemblies of the latest TVE3 SVN.

Release 1.0.15.0 (January 23rd, 2008)

Changes since the previous release:

  • Implemented importing and exporting of schedules from the management console.
  • Improved code to handle global resources in Web Access.
  • In Web Access, tweaked LogonPanel and added "Log off" button to main titlebar.
  • Small tweak/fix to GetUpcomingProgramsOperation.
  • Bug fix: record buttons now work again from the Web Access TV Guide popups.
Release 1.0.14.0 (January 16th, 2008)

Changes since the previous release:

  • Fixed TVE3 plugin to use the same Gentle.NET version as TVE3 itself.
  • Some fixes to the german and italian translations in Web Access.
Release 1.0.13.0 (January 15th, 2008)

Changes since the previous release:

  • Added "Skip repeats" checkbox to the Edit Schedule panel in the management console and Web Access.
  • TV Scheduler Web Access is now fully translated into Dutch, German and Italian.
  • Upcoming programs in Web Access show more details now (more columns).
  • TvScheduler.Entities.dll no longer has a dependency on Gentle.NET so TV Scheduler client applications no longer need to needlessly reference it (there's never any database access client-side anyway).
  • Web Access culture is now set in Web.config (so can be overridden by the user if he or she prefers this).
  • Bug fix: TV Guide in Web Access now correctly defaults to the current time.
  • Bug fix: fixed invalid query for schedules containing only unknown TV channels.
Release 1.0.12.0 (January 10th, 2008)

Changes since the previous release:

  • Bug fix: Web Access error page should now display correctly.
  • Bug fix: Web Access EPG grid sometimes gave a duplicate control ID error.
Release 1.0.11.0 (January 9th, 2008)

Changes since the previous release:

  • Changed Web Access TV Guide to a time-line EPG view. Clicking the channel name or logo shows the view that was used before.
  • Two new rules to record programs with episode titles that contain or start with a certain text.
  • Added new service method to support channel logos. There is a new "Channel Logos" directory in the installation directory of the service where you can copy high-quality logos of your channels. These will then be shown in the Web Access EPG.
  • Added AuthenticationEnabled setting to WebAccess, default set to True.
  • Tweaked "Waiting..." indicator in Web Access, now only appears when postbacks take longer than 300ms.
  • Upcoming programs list now displays program times in a clearer format. Shows program details in a popup when you click the title.
  • Fixed the management console to work over Terminal Services (Remote Desktop).
  • Web Access now fully supports cultures that use AM/PM times.
  • Implemented Recordings panel in Web Access.
  • Some other visual tweaks to Web Access.
Release 1.0.10.0 (December 11th, 2007)

Changes since the previous release:

  • The NewEpisodesOnly rule will now also work when different descriptions are used for different episodes.
  • Bug fix: EndRecording() gave an error when a recording ended that did not contain an episode title.
Release 1.0.9.0 (December 11th, 2007)

Changes since the previous release:

  • Major new feature: TV Scheduler Web Access, a web-based frontend to view/edit your scheduled programs remotely.
  • New rules to only record unique titles. Useful when recording movies with a certain actor e.g.
  • In the management console, it's now possible to view and edit the history of recorded programs attached to a schedule (the list used to skip previously recorded episodes/titles).
  • Bug fix: the query for DaysOfWeek on SQL Express now takes the DATEFIRST setting into account.
Release 1.0.8.0 (November 28th, 2007)

Changes since the previous release:

  • Implemented secure HTTP channel for remote clients. Now you can safely access your schedules from anywhere in the world!
  • TVE3 plugin now always automatically links channels on their display name.
  • Added "Search TV Guide" panel to the management console.
  • Added "Guide Channels" administration panel to the management console.
  • Small fix to TVE3 plugin's end-recording handling.
Beta release (November 23rd, 2007)

Changes since the previous release:

Beta release (November 22nd, 2007)

Changes since the previous release:

  • Display version number in title of the console.
  • Panels with OK/Cancel in the management console will now hide the menu.
  • Switched back to old installers, there were too many problems with the new WiX installer.
  • Fixed quotas on WCF bindings.
  • EPG syncing in TVE3 plugin will now first try to match on the channel's displayname, before creating a new channel.
  • TVE3 plugin will retry connection to TvScheduler when starting up.
Beta release (November 17th, 2007)

Changes since the previous release:

  • Upcoming recordings/alerts/suggestions are now sortable.
  • Some data-binding tweaks to the management console panels.
  • Some tweaks to the WiX setup script, hopefully fixing the setup issues that were reported.
Beta release (November 14th, 2007)

Changes since the previous release:

  • Added channel edit panel to the management console. You can now change the order of channels, their name and the link to the guide,...
  • Added channel groups, complete with a management console edit panel.
  • Added the new channel groups to the TV Guide and schedule editing panels.
  • Schedules list and log list are now sortable by clicking on the column headers.
  • Switched to a complete new setup based on WiX. The service is now also automatically started at the end of the setup.
  • Added EPG synchronization thread to TVE3 plugin to sync TVE3's EPG into TvScheduler for DVB-EPG users.
  • When editing a schedule pre- and post-recording times that are not active (checked) now show the defaults.
  • Some small fixes to the management console.
Beta release (November 3rd, 2007)

Changes since the previous release:

  • Added and implemented IsActive flag on schedules, and an "Active" column to the management console.
  • Added NewEpisodesOnly rule. This will automatically skip previously recorded programs, as long as you have guide data that also contains either the episode title or the episode number.
  • Added "Record This Program" to popup window in Upcoming Suggestions/Alerts.
  • When creating/editing a schedule the Description rule may now also contain a ";" separator, in which case all of the substrings need to be present in the description.
  • Changed Sub-title to Episode and Episode to Number.
  • Changed the way transactions are handled for guide importing.
  • Pass on original exception message to FaultException thrown in service layer now.
  • Bug fix: Fixed problem with Open/Delete buttons in Recordings panel when no recordings were available.
Beta release (October 31th, 2007)

Changes since the previous release:

  • Added "Add All" button to TV channels and Categories in the Edit Schedule panel, and a label that is displayed when no channels or categories are selected. Listboxes are also multi-select now to make it easier to remove multiple entries.
  • When creating/editing a schedule the title Contains rule may now contain a ";" separator, in which case all of the substrings need to be present in the title.
  • Changes to pre- and post-recording or the schedule's priority are now also synced by the MediaPortal plugin.
  • Bug fix: VeryLow schedule priority now works again.
Beta release (October 30th, 2007)

Changes since the previous release:

  • Added recordings to TvScheduler, grouped by either channel or schedule.
  • The name of manual schedules is now built automatically.
  • Added TVE3 plugin to synchronize TvScheduler upcoming programs into TVE3 schedules.
  • Fixed MySQL problems.
Beta release (October 19th, 2007)

Changes since the previous release:

  • Implemented caching for calculating upcoming programs -- this enormously speeds up repeated calls.
  • It is now possible to (un)cancel specific upcoming recordings from a series-recording.
  • Manual schedules are now supported.
  • Added keep-until setting to recording schedules.
  • TvScheduler.WindowsService will now delete old guide data every day (everything before yesterday).
  • Added Settings panel, with e.g. global pre- and post-record settings.
  • Added "Edit Schedule" item to popup in TV Guide.
  • Added new and more icons, more GUI cleanup.
  • Added icons to upcoming programs grids.
  • Implemented preferred guide source and pre- and post-record settings.
  • Added "IsCancelled" to UpcomingProgram and UpcomingGuideProgram.
  • Bug fix: Fixed problem with datetime casting in SQL Express for OnDate rule.
  • Bug fix: time in Upcoming Programs grid is now also displayed for midnight (00:00).
  • Bug fix: XMLTV import was broken when two programmes with the same title were right after one another.
  • Bug fix: XMLTV import timezone calculation was reversed, fixed now.
Important points:

Download:
Downloads removed.
Visit For The Record for downloads.

What can be tested?

Once the service is up and running you can try the following:

1) drop a guide XMLTV file into C:\Program Files\dot-i\TvScheduler\xmltv. Any file with .xml extension will be imported by the service. It should be processed and moved to an 'Imported' directory.

2) start the Management Console on the server (there will be an icon on your desktop and in the start menu). Browse the TV guide, try right-clicking a program and schedule a recording. Play around with the console, you can add your own schedule from scratch for example. Check what programs are in the upcoming recordings list, etc...

3) install only the Management Console on another PC on your network (separate setup). Try running it and connect to the TvScheduler on your server machine. You may have to open the TCP port in your firewall.

4) make sure your server has IIS installed and if you are running Vista that you've installed support for ASP.NET and all IIS6 compatibility modules.

If you install IIS on an already installed XP machine you may have to run this command:

"aspnet_regiis -i" under "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"

Also make sure you have the Ajax extensions installed: Download details: ASP.NET AJAX 1.0.

Then use the provided setup to install TV Scheduler Web Access. After installation you will have to edit the Web.config in C:\inetput\wwwroot\TvScheduler.WebAccess to provide a password. Then surf to http://localhost/TvScheduler.WebAccess to test out the site locally. You may have to open up port 80 in your firewall, then test the site remotely.

5) unzip the TVE3 plugin assemblies into TVE3's plugins directory. Use TV Server's management console to change its recording directory into a UNC path (\\MACHINE\Path\) if you want to be able to access the recorded files from another machine using TV Scheduler's management console.

The TVE3 MediaPortal plugin has a GUI where you check the links between TvScheduler channels and MediaPortal channels. Check all your channels are linked, then activate the plugin. Once it's fully configured and running it will automatically synchronize all TvScheduler's upcoming programs into TVE3 manual schedules. And when TVE3 records the programs the recordings will be registered with TvScheduler. Happy testing!

I'm looking forward to reading about your experiences/gripes/suggestions either positive or negative here in this thread.

Thanks in advance for all the testing effort!

PS: if you encounter an "Unexpected error" messagebox, be sure to check the EventLog (eventvwr.exe) and check out what has been logged under TvScheduler.

-------------- cut --------------

First alpha release (september 5th, 2007)

The TvScheduler service (see below for the start-post to this thread) is ready for some initial testing.

Download: removed

What can be tested?

Once the service is up and running you can try the following:

1) drop a guide XMLTV file into C:\Program Files\Team MediaPortal\TvScheduler\xmltv. Any file with .xml extension will be imported by the service. It should be processed and moved to an 'Imported' directory.

2) After you've tried to import one or more guides, please use SQL Server Management Studio or MySQL Administrator to look at the TvScheduler database. The Log table will give some high-level logging about the import process and the TvChannel, GuideChannel and GuideProgram tables should contain all the program data.

3) Try to browse to the following URLs with Internet Explorer:

blockedcontent
blockedcontent

4) Try to browse to these URLs from another machine on your network (replacing blockedcontent with the IP or name of your server machine). You may have to add port 49941 to your firewall to allow traffic through.

Note that in this stage so called power-users are needed for testing, there's no GUI yet ;)

What's next

I'll post a simple WinForms program next that demonstrates some of the service APIs (to show what's possible with the rule-based system). But it would be interesting to get feedback on the basic stuff first.

Thanks in advance for testing this out!


-------------- cut --------------

Hey all,

Together with a friend I've been working on a scheduling sub-system that could be used by MediaPortal and/or TVEngine3.

Things are progressing nicely and I wanted to give a status update, offer some technical points, and most importantly, check if there's feedback on how and where we are heading. Good ideas are always welcome of course :)

Technology

The scheduling subsystem is built as a Windows Service (like TVE3) that hosts a few Windows Communication Foundation (WCF) services. These services are exposed with two endpoints: net.tcp:// for fast communication with WCF clients and http:// for industry-standard communication web-service communication.

So basically the system is perfect for client/server setups.

As database SQL Express is used at the moment, but I see no reason why MySQL should not also work. Like TVE3, Gentle.net is used for data access.

Overview

At the moment there are four services, of which two are the heart of the system and two support services:

  • GuideService
  • SchedulerService
  • LogService
  • ConfigurationService
The guide service offers both XMLTV importing and the possibility to feed DVB-EPG guide information. It will be possible to configure which information takes priority (a user may prefer the DVB-EPG to overwrite any XMLTV guide information already in the database, or the other way around).

The scheduler service handles the most important part: managing scheduling of programs. This is a rule-based system (more on that below). Schedules can be created/updated/deleted of course and there are methods to get all the upcoming recordings in general or for a specific schedule.

The log service and configuration service are support services, lower-level things to make the rest work. Logging is desgned as high-level "application logging", so not to be confused with low-level .txt logs that are more useful for debugging.

Rule Based

The scheduler is rule-based, this means it does not work with a single "schedule type", but can be configured as simple or as complex as you want. This makes it extremely powerful. As a simple example, it will be possible to record all documentaries with "global warming" in the description on BBC1 or BBC2.

Schedules also have a priority to help the recording system to decide which one is more important to record (this can help in case there are conflicts).

Here's a list of the rules as we have them currently defined:

Code:
public enum ScheduleRuleType
{
    TvChannels = 0, // Record on the given channel(s).
    Time = 1, // Record at the given start/stop time.
    AroundTime = 2, // Record the timeslot closest to the given start time (usually combined with TitleEquals).
    DaysOfWeek = 3, // Record on these days of the week.
    TitleEquals = 4, // Record program with the given title.
    SubTitleEquals = 5, // Record program with the given sub-title.
    TitleContains = 6, // Record program who's title contains the given text.
    DescriptionContains = 7, // Record program who's description contains the given text.
    CategoryEquals = 8, // Record programs from this category.
    DirectedBy = 9, // Record program directed by given name.
    WithActor = 10 // Record program which has the actor by the given name.
}
Rules have one or more arguments as well (as can be seen from the comments). For example, the "DaysOfWeek" rule will have an enum (flags) argument in which you can "OR" together all the days you want the schedule to be active (Mondays, Tuesdays and Thursdays, or simple WorkingDays, or simply one day in the week,...).

Rules will always be AND-ed together. So the more rules, the more specific the schedule will be.

Code:
ScheduleRules rules = new ScheduleRules();
rules.Add(ScheduleRuleType.DaysOfWeek, ScheduleDaysOfWeek.Mondays | ScheduleDaysOfWeek.Fridays);
rules.Add(ScheduleRuleType.DescriptionContains, "MediaPortal");

TvSchedule schedule = schedulerService.AddSchedule("Example", SchedulePriority.Normal, rules, null, null);
A lot of the stuff described here is already working, and while it does need a fair amount of extra work, this is not a pipe dream, it's a real project ;)

Before I go one step further, and start posting more technical details like the service's API I'd welcome feedback on the story so far.

Any general comments? Any ideas on the rules or new rules that can be added? Questions? ...
 

psiebe

Portal Pro
March 29, 2007
93
1
52
Home Country
Netherlands Netherlands
This sounds really, really good, I always found the recording / schedule stuff to be a bit under par.

Hope you make a good interface though as I tend to mixup code when doing manual rules ;)
 

The_Stig

Retired Team Member
  • Premium Supporter
  • April 5, 2005
    2,176
    428
    As we have already discussed on IRC, I like that idea.
    Will it be possible to have schedules like "Everytime on every channel where 'Tim Allen' is in description when starting time between 7pm and 10pm"?
     

    dvdfreak

    Portal Pro
    June 13, 2006
    979
    178
    Home Country
    Belgium Belgium
    This sounds really, really good, I always found the recording / schedule stuff to be a bit under par.

    Thx!

    Hope you make a good interface though as I tend to mixup code when doing manual rules ;)

    Well, step 1 is to make a good service interface ;), as in API.

    But you are quite right that a good interface, as in GUI, is very very important too. We can't expect a user to simply provide low-level rules, this should be wrapped in a nice, clean and user-friendly GUI. Any enthousiasts who want to write a new MediaPortal Schedule plugin that talks to this new service? :D
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Home Country
    Germany Germany
    Don't forget the power scheduler, i.e. we need to know when the *next* scheduled recording occurs.

    dero
     

    dvdfreak

    Portal Pro
    June 13, 2006
    979
    178
    Home Country
    Belgium Belgium
    As we have already discussed on IRC, I like that idea.
    Will it be possible to have schedules like "Everytime on every channel where 'Tim Allen' is in description when starting time between 7pm and 10pm"?

    With the currently defined rules: almost :)

    There's an AroundTime rule, but this would record the timeslot closest to a certain start time. So that's not entirely what you want.

    So we can add a "BetweenTimes" rule, not a bad idea! So in code we get this:

    Code:
    ScheduleRules rules = new ScheduleRules();
    rules.Add(ScheduleRuleType.BetweenTimes, new TimeSpan(19, 0, 0), new TimeSpan(22, 0 0));
    rules.Add(ScheduleRuleType.DescriptionContains, "Tim Allen");
    TvSchedule schedule = schedulerService.AddSchedule("I love Tim Allen", SchedulePriority.Normal, rules, null, null);

    And since there is no TvChannels rule all channels will be looked at.

    Don't forget the power scheduler, i.e. we need to know when the *next* scheduled recording occurs.

    dero

    Yes, very important. This will be in there!
     

    THDBASED

    Portal Pro
    January 30, 2006
    469
    2
    Home Country
    Belgium Belgium
    So I hope than when this is finished this will replace the current scheduler code in MP because an other external program makes things only more difficult maybe not so much for power users but definitely for first-time users.
     

    dvdfreak

    Portal Pro
    June 13, 2006
    979
    178
    Home Country
    Belgium Belgium
    So I hope than when this is finished this will replace the current scheduler code in MP because an other external program makes things only more difficult maybe not so much for power users but definitely for first-time users.

    Agreed! :)

    In any case, first this needs to work as a standalone subsystem. Once that is done we can "relatively easily" modify MediaPortal to use this new scheduler rather than its own.

    A possibility is to start with a new Schedule GUI plugin like I mentioned a bit higher up, which talks to this new system. This would allow us to do some end-user testing without impacting MP's stability, since it's totally separate still.

    In the end this new plugin could then actually replace MP's standard scheduling screen.

    I don't know if there are people with both enough free time and the needed skills, but help in this area is more than welcome :)
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Home Country
    Germany Germany
    If you'd like it to replace the built-in scheduler, your scheduler has to meet TV-Server 3 coding standards.

    dero
     

    dvdfreak

    Portal Pro
    June 13, 2006
    979
    178
    Home Country
    Belgium Belgium
    If you'd like it to replace the built-in scheduler, your scheduler has to meet TV-Server 3 coding standards.

    As in following C# coding guidelines? Or as in: the scheduler API must provide TVE3 with all it needs?

    In any case, everything so far has been developed very cleanly using common .NET coding guidelines with code readability in mind and including unit testing.

    I'm happy to provide a more technical look if people are interested, which assemblies are there, which services, their API, etc... (perhaps in a separate thread?) But I just wanted to get some initial opinions before delving that deep. And I'm happy with the response so far, I already added the definition for the BetweenTimes rule for example :)
     

    Users who are viewing this thread

    Top Bottom