Watched flag

7 posts / 0 new
Last post
Offline
Joined: 17 Aug 2010
Watched flag

Hi, I have made signifigant progress with the UI portion of TvBrowser - MCML is actually not that bad once you get used to the layout options.  My question is now concerning how to mark the shows "watched" in my DB.  Obviously, this is simple when the show is played through my app.  Does anyone have an idea on how to flag shows watched through WMC, but not through my app.  I tried to create a background app and handle the Media Transport obejct's Property Changed event, but i cant get that to work.  I seem to get a null reference on the Media Experience object always.  Does anyone know if this is possible, or if i am wasting my time? 

mikinho's picture
Offline
Joined: 19 Mar 2007

You have a few options, I don't suggest the background add-in route though (the least efficient method).  If you do want to go w/ that you'll need use reflection to reset the MediaTransport cache. I can give some sample code.  Another option is Media Sink...which also has a whole set of caveats but better than the background add-in.

Mikinho | Missing Remote | Windows Entertainment and Connected Home MVP

Offline
Joined: 17 Aug 2010

Yeah, i figured as much.  I'm wondering how important it is anyway.  Im not going to be able to mark shows that are watched live either - so it's probably just more important to make the manual process of "marking watched" as simple as possible.  Also, once i have a version closer to complete, i am probably going to put the project on google code - which should make getting help easier.

Offline
Joined: 17 Aug 2010

Michael,

How would you recommend scanning directories for file changes?  Use the FileWatcher object in system.IO?  Or is that too expensive?  Im not sure what the buffer limitations translate to in real life with that object (i havent used it much).  Create my own scanner on a timer?

mikinho's picture
Offline
Joined: 19 Mar 2007

Generally you'd need more than one method. Below is what I use:

1- At "start up" do a manual scan for changes. This is needed if you are monitoring network shares that may have been changed when you are offline

2- Periodic scans similar to above. This is needed for SMB shares that do not support change notifications

3- FileWatcher. Easy to use and if done properly low resources (easy to do improperly too)

4- NTFS Journaling. Using the USN Journal is more efficient than FileWatcher but obviously only works on NTFS.

I recommend at least 1-3 to start with.  Media Center itself uses a combination of 1-3 though it uses the Win32 API versus FileWatcher.

Mikinho | Missing Remote | Windows Entertainment and Connected Home MVP

Offline
Joined: 17 Aug 2010

Excellent, i am using 1-3 currently (exactly as you outline).  I will look into NTFS Journaling.  Thanks for the help, let me know if i get annoying.

mikinho's picture
Offline
Joined: 19 Mar 2007

Nmarconi wrote:

Thanks for the help, let me know if i get annoying.

You are welcome. And don't worry, I really enjoy giving feedback and am looking forward to seeing what you release.

Mikinho | Missing Remote | Windows Entertainment and Connected Home MVP

Login or register to post comments
Website design by Yammm Software
Powered by Drupal