- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by mikinho.
June 22, 2012 at 2:11 pm #26678
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?June 23, 2012 at 12:10 am #32569mikinho
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.June 26, 2012 at 12:41 am #32584Nmarconi
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.June 26, 2012 at 9:06 pm #32596Nmarconi
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?June 27, 2012 at 12:08 am #32597mikinho
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.June 27, 2012 at 2:37 am #32598Nmarconi
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.June 27, 2012 at 2:42 am #32599mikinho
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.
- You must be logged in to reply to this topic.