View Full Version : Refresh DVD list if XML file has changed

June 25th, 2009, 02:29 PM
I am trying to get the DVDprofiler GAC to rebuild on a button press so that the DVD GAC reflects a new XML file

Any suggestions?
The only way I can get it to work is by closing and restarting MB

(I am using girder to change the xml file defined in Mediabridge to allow browsing of different collections)


June 25th, 2009, 05:34 PM
If you're lucky there might be a secret refresh command... I found this in the manual...

Generic MediaBridge Command: (Advanced) sends commands directly to the MediaBridge Server. These commands are not documented at present, but from time to time they are mentioned in the Promixis forums as solutions for specific problems..

Hopefully the bigger boys will chime in :)

Rob H
June 25th, 2009, 07:59 PM
Not sure about that, but I'll see what I can dig up tomorrow.

June 26th, 2009, 02:19 AM
thanks Rob

Rob H
June 26th, 2009, 05:09 AM
Hmm... there's no explicit command to do this. However, the DVDItems collection should automatically refresh if the timestamp of the XML file is newer than the last time the DVDItems collection was accessed.

June 26th, 2009, 10:43 AM
I'll see if I can get the timestamps to change, maybe by creating a new blank file before copying it over with one of the "real" xml files

June 27th, 2009, 12:15 PM
sorted thanks
if the date CREATED is more recent than the original file the list refreshes

I just changed my batch files to create a new file each run rather than overwrite the original

June 27th, 2009, 12:22 PM
spoke too soon!!
it appears that the list only automatically updates if the date changes rather than just the time

swear word

Rob - any hope of changing this or any suggestions re an alternative?

(other than wait with baited breath for a new installment of MB / DVDProfiler integration ;-)

Rob H
June 27th, 2009, 01:02 PM
Hmm... that's odd, here's the code

DateTime d = File.GetLastWriteTime(DVDCollectionFile);
if (d > dvdItemFileTime)

Looks to me as though it should work if the time changes

June 27th, 2009, 01:52 PM
you're right

it seems that if you delete a file (say collection.xml) and then create a new file with the same name, the created date remains as per the original file!

an example of the batch file I am using is...

del "\\conservatory\Documents\DVD Profiler\Databases\collection.xml"
echo . >> "\\conservatory\Documents\DVD Profiler\Databases\collection.xml"
xcopy "\\conservatory\Documents\DVD Profiler\Databases\collection-comedy.xml" "\\conservatory\Documents\DVD Profiler\Databases\collection.xml" /Y

am i missing something or should I shoot Bill Gates?

June 27th, 2009, 01:57 PM
any file created with the same name as a previously deleted file reverts to the orginal file's create date!!!!
the date modified value just stays the same as the original file

June 27th, 2009, 02:30 PM
The master of sellotape and string strikes again!

it appears that this is a known issue/feature of windows
I downloaded a command line utility called stamp.exe (http://users.csc.calpoly.edu/~bfriesen/software/console.shtml)

that sets the date created to xxx in my batch file and the list now refreshes perfectly (so far!)

Thanks for your help Rob

Rob H
June 27th, 2009, 03:54 PM
Well, you were creating a new file then overwriting it with a different file using xcopy which will copy over the datestamp I believe.

Personally, I'd use a bit of Lua to do this rather than a batch file.