Howdy,
OK, made some progress on the dvdprofiler sync so thought I'd share it.
First, the sync consists of three commands:
* isbn_dvdprofiler (used to add ISBN attribute to pluto_media File objects based on fuzzy title match with DVDProfiler exported profiles),
* sync_dvdprofiler (used to replace pluto_media File object's attributes with values from DVDProfiler exported profiles),
* missing_isbn (used to show.pluto_media File object's that don't have an ISBN attribute).
isbn_dvdprofiler
DVDProfiler keys it's database off of the movie's ISBN while LMCE keys off of path + filename (ok, technically the pluto_media.file object). Each database has a title for each DVD, so the first command attempts to match via a fuzzy match (lowercase all words, drop punctuation, with and without "The", "A", or "An" prefixes, minimize whitespaces). This is matching about 90% of my 543 movies. Matching does not work with boxed sets. Actually I'm not sure how to handle multiple movies to one ISBN, currently I'm just ignoring them (i.e., use LMCE data).
sync_dvdprofiler
The second part is the actual sync'ing of attributes and images. When a pluto_media File object has an "ISBN" attribute, then the following attributes are replaced using the DVDProfiler data: Genre, Release Date, Rated, Run Time, DVD Release Date, Synopsis, Title, Performer (limited to first 10 actors).
missing_isbn
The last part is a report of what dvd media does not have an ISBN attribute. Basically helps you to manually (via pluto admin) add the ISBN attribute for the files that the auto ISBN matching script had troubles with.
Workflow
The workflow is:
1) Export profiles from DVDProfiler
2) isbn_dvdprofile
3) sync_dvdprofile
4) missing_isbn
5) manually add ISBN attributes using pluto admin
6) go to #3
When you add DVDs or update profiles in DVDProfiler, then you just run through the workflow from the start. There are some optimizations to prevent resyncing unchanged objects.
Current Status
Initially the script was developed on my workstation using a copy of the databases. I've added Capistrano deployment to my dcerouter. I've ran and verified core functionality of the commands on my dcerouter.
To Do
I need to test the condition where I do a reinstall without keeping the database to see what happens with the new ISBN pluto_media.AttributeType. I pessimistically expect that update media might not like it. Also need to verify that my capistrano deployment recipe contains all of the dependencies.
Next I'm going to move the functionality into a rails controller so the commands will be accessible via RESTful routes. I'll write some simple scripts to access the commands via the RESTful routes.
Then I need to decide how best to package everything.
I'm still undecided on whether a web UI would be useful or not. I'll probably play with a basic scaffolded UI just to see.
Have fun,
Roy