WTVWatcher starts conversion too early in some cases

Nov 15, 2010 at 9:38 PM
Edited Nov 16, 2010 at 12:07 AM

This appliation works well for the most part, however, I have seen instances where it seems to start converting too soon.  What I mean is, I'll drop a file into the directory it's monitoring and it starts to convert after the latency time has expired.  If I drop a second file into the directory while the first one is converting, instead of waiting for the latency, it will move on to the next file immediatly after it's done with the first.  Am I not understanding how this application works?  Is it supposed to wait the latency period for all files or once it's started it will do all files in the directory?

I am using the Windows Home Server TV Archive service with the WTVWatcher service watching the Recorded TV folder on the Home Server.  It seems that if the WTVWatcher has started conversions and my TV Archive starts to copy a new file over while it's converting, it gets added to the list of files to convert and tries to convert it before it's done copying.

Nov 17, 2010 at 3:32 PM

I have found that the issue is a little more complex.  The code is getting the files based on the last time the file was written to, which if it was local to the Media Center PC would be fine.  However, the DateTime stamp of a file being copied from the Media Center PC to the Home Server does not change so the WTVWatcher thinks it's being done written to and tries to convert it.  I downloaded the source code and made a stab at altering to code to work for me and ran into the same issue.  I think I'll need to use a combination of my modified code with a FileSystemWatcher object utilizing the OnChanged event to keep track of which files are still in the process of copying.

Dec 11, 2010 at 1:11 AM

You're spot on. Media Center does not properly maintain the file attributes as one would expect them to. The FileSystemWatcher object was the only way to monitor changes (to size, etc.)

I've written the updates, but am testing the code thoroughly in house before posting the update, which will include much better support for file change tracking. Look for the update this weekend.