Hi,
I don't know if there is an easier alternative to import XBMC's database into MeD's, but I just wrote a small python script to convert the most important data (title, imdb id, file path) to a CSV readable by MeD's.
Here it is:
Code:
#!/bin/python
import re,sys
from xml.sax.saxutils import unescape
def getElems(fc,elem):
a=re.findall("<"+elem+">(.+?)</"+elem+">",fc,re.M|re.DOTALL)
return a
def getElem(fc,elem):
a=getElems(fc,elem)
if len(a)>0:
return unescape(a[0], {"'": "'", """: '"'})
else:
return None
def printHeader():
print '"title","imdb","location"'
def correctPath(path):
if path.find("stack://")>-1:
path=path.replace("stack://","")
path=path.replace(" , ","*")
path=path.replace(",,",",")
return path
if len(sys.argv) !=2 :
sys.stderr.write("usage: "+sys.argv[0]+" path/to/videodb.xml [> output.csv]\r\n")
sys.exit(1)
printHeader()
f=open(sys.argv[1],"r")
fc=f.read()
movies=getElems(fc,"movie")
for movie in movies:
title=getElem(movie,"title").replace("\"","'")
imdb=getElem(movie,"id")[2:]
path=correctPath(getElem(movie,"filenameandpath"))
print '"'+title+'","'+imdb+'","'+path+'"'
Install python, export your database to a single file and start the following from the command line (assuming you are in the directory of videodb.xml and have python in your path):
python xml2csv.py videodb.xml > videodb.csv
In MeD's, select import from csv, select UTF-8 encoding and import your file. Important: Select the option NOT to query IMDB for information. Otherwise it'll search imdb for every movie's title.
In the next screen with the spreadsheet, right-click the columns to assign "IMDB", "Title" and "File Location" to the fields. Import everything.
Select tools->Update IMDB info. Select everything you want to fetch from IMDB (I unchecked title and AKA, because they both(!) overwrite the title I renamed the movie to). It takes a while to re-fetch all information from IMDB, but at least you don't have to re-select every movie in you collection.
Hope this works for you too!