2009-12-29, 06:53 AM
I'll be uploading this to the GBPVRLibrary project but here is a quick build of just the MediaCenter metadata part. I'll be removing this download once I commit it to the library.
http://www.oshinetworks.com/DirectShow/G...Center.zip
I included a copy of DirectShowLib-2005.dll (needed for reading the DiscID) if you don't already have it. Just place the contents of the zip file in the Plugins\common folder and add it as a reference to your project.
Some quick usage examples:
Reading a DVD ID and checking for online metadata (first checks the MS datasource and then e-home.no if the MS call fails):
GBPVRLibrary.UtilityLibrary.DvdId also contains two static methods for converting between long and string dvdids without needing to re-read the disc.
You can get more info using SOAP calls instead. You can get the cast list and characters they played, similar movies, etc. The downside is that you need to make multiple calls for the info you want and then convert the data to the DvdInfo. I recommend trying to get the DVDInfo first and then updating it with the extra data. To get the basic DVD data:
You can also use GetMovieCandidates() to search by movie title and release year/date. GetMovies() will search by the wmContentID (a Guid value).
I've currently hardcoded the locale as "us-en" (id: 409). I will make this changeable before I commit it to the library.
Now I just have to figure out how MediaCenter is getting the DiscID for Blu-rays.
http://www.oshinetworks.com/DirectShow/G...Center.zip
I included a copy of DirectShowLib-2005.dll (needed for reading the DiscID) if you don't already have it. Just place the contents of the zip file in the Plugins\common folder and add it as a reference to your project.
Some quick usage examples:
Reading a DVD ID and checking for online metadata (first checks the MS datasource and then e-home.no if the MS call fails):
Code:
long dvdid= GBPVRLibrary.UtilityLibrary.DvdId.GetAsLong("D:\\"); // Reads a disc to get the dvdid.
GBPVRLibrary.MetadataLibrary.MediaCenter.DVD.Metadata metadata = GBPVRLibrary.MetadataLibrary.MediaCenter.DVD.Metadata.GetDvdInfo(dvdid); // This call can accept a string if you want to read the dvdid from a dvdxml file instead.
bool b = metadata.Save(@"c:\dvdtest.xml"); //Save the metadata to a file. Returns false if the save fails.
GBPVRLibrary.UtilityLibrary.DvdId also contains two static methods for converting between long and string dvdids without needing to re-read the disc.
You can get more info using SOAP calls instead. You can get the cast list and characters they played, similar movies, etc. The downside is that you need to make multiple calls for the info you want and then convert the data to the DvdInfo. I recommend trying to get the DVDInfo first and then updating it with the extra data. To get the basic DVD data:
Code:
GBPVRLibrary.MetadataLibrary.MediaCenter.Video.DvdRequest dr = new GBPVRLibrary.MetadataLibrary.MediaCenter.Video.DvdRequest();
dr.Crc64 = (ulong)GBPVRLibrary.UtilityLibrary.DvdId.GetAsLong("D:\\"); // You must cast to ulong to set the DvdRequest.Crc64 or the SOAP calls will fail..
GBPVRLibrary.MetadataLibrary.MediaCenter.Video.WMMovieMetadataProvider md = new GBPVRLibrary.MetadataLibrary.MediaCenter.Video.WMMovieMetadataProvider();
GBPVRLibrary.MetadataLibrary.MediaCenter.Video.DvdMatch[] matches = md.GetDvdCandidates(dr);
You can also use GetMovieCandidates() to search by movie title and release year/date. GetMovies() will search by the wmContentID (a Guid value).
I've currently hardcoded the locale as "us-en" (id: 409). I will make this changeable before I commit it to the library.
Now I just have to figure out how MediaCenter is getting the DiscID for Blu-rays.