xDBImportExport
This plugin will import/export xlobby databases so settings will not be lost if the database is deleted.
Before it modifies the database (durring an import) it will save a copy of the original database as database.xml.bup, so if anything goes wrong you can restore it from there.
This is something I knocked up for myslef a while ago (I kept moving my films and having to re-spider them) because I could not be bothered using dvd profiler.
I have tried to make the code a bit more readable and it should now work on nested structures (eg Movies\TV\Futuramma\Series1, Movies\TV\Futuramma\Series2 etc) its also not limited to the movie database.
I do not parse the database file properly (I do not use any xml functions), instead i effectively treat the database as a big text file and do lots of automated copy/paste operations – its not pretty but it works for me.
If anyone feels like coding it properly go for it, but be nice and share the source code so others can see how it works
Download link (including source code) -
http://www.france.xlobby.com/plugins/xD ... Export.zip (updated on 9 June 2006)
Functions are -
export:database_path
This will look for the file database_path and save any Items in lots of files called <parameter>.xImportExport, where <PARAMETER> is the parameter entry in the database, if <parameter> is a directory it will create a file called <parameter>\dir.xImportExport.
It will export all fields for an item appart from the <coverart> tag, if there is anything else I should skip let me know.
import:database_path
This will look for the file database_path and for each Item in it it will try and find the matching <parameter>.xImportExport file.
If it does find a xImportExport file it will replace the <item> data with that contained in the file. If an xImportExport file is not found the data will not be changed.
Notes
The database path can be a simple string like movies or music or a path to a file.
If you pass in a simple string the plugin will assume you ment -
movies -> ...\XLobby\Databases\movies.xml
If you pass in a path and the plugin can not find the file you specified, it will check to see if there is a matching path inside inside the Xlobby directory -
C:\FunnyDbLocation\DB.xml –> full path specified.
skins\Htpc\databases\menu.xml -> ...\XLobby\skins\Htpc\databases\menu.xml
If it still fails to find the file an error message is shown.
Please remeber that this is not a “smart process” and if the data in xImportExport file is rubish the database will be corrupted...
I have tested this on my movie, picture and music databases, but if you have manually edited your database altered its layout it may not work...
Sean.