Last active
December 11, 2015 00:09
-
-
Save HarHar/4514541 to your computer and use it in GitHub Desktop.
Put this on the Futaam root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from interfaces.common import * | |
from libYAAM import YAAMDb | |
olddb = raw_input('Path to YAAM database file> ') | |
newdb = raw_input('Path to new Futaam file> ') | |
o = YAAMDb(olddb) | |
ni = [] | |
i = 0 | |
for x in o.entries: | |
a = {} | |
for y in x: | |
if x[y] == 'null': x[y] == '' | |
a['name'] = x['name'] | |
a['id'] = i | |
a['genre'] = x['genre'] | |
a['lastwatched'] = x['LW'] | |
a['obs'] = x['obs'] | |
a['type'] = o.dbclass | |
ts = x['status'] | |
if ts.lower() == 'n': ts = 'd' | |
a['status'] = ts | |
a['aid'] = x['id'] | |
ni.append(a) | |
i += 1 | |
parser.createDB(newdb, 'json', o.dbname, 'Imported from YAAM', ni) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment