mirror of
https://github.com/evilhero/mylar
synced 2025-01-03 13:34:33 +00:00
Fixed some problems loading exceptions, included some details in csv file now
This commit is contained in:
parent
5fb5e56532
commit
dd96a80a18
2 changed files with 31 additions and 2 deletions
|
@ -1,6 +1,25 @@
|
||||||
|
#Mylar Exception listings
|
||||||
|
# In an effort to map ComicVine to GCD correctly, use this.
|
||||||
|
#----
|
||||||
|
#Required Format : code, ComicVineID, GCDComicID, GCDComicIDs (for volume spanning series)
|
||||||
|
#----Format Breakdown
|
||||||
|
#code = # of volumes in series to be checked minus 1 (if there are 4 volumes in a series, put 3)
|
||||||
|
= 99 is mismatched names. If a series won't match on GCD, this is what you would put.
|
||||||
|
#ComicVineID = the ComicVineID (taken from the searchresults, or the ..Loading.. detail screen)
|
||||||
|
#GCDComicID = the correct GCD Comic ID that Mylar is to match with.
|
||||||
|
#GCDComicIDs = put the GCD Comic ID's here for the given multiple volume spanning series seperated by a '/'
|
||||||
|
#use 'none' if you are not using an option (yes, it's necessary)
|
||||||
|
#--------
|
||||||
|
#--------
|
||||||
|
#-----Volume Spanning Series-----
|
||||||
|
#Fantastic Four
|
||||||
4,2045,none,1482/10251/6029/11218/62349
|
4,2045,none,1482/10251/6029/11218/62349
|
||||||
|
#Amazing Spider-man
|
||||||
2,2127,none,1570/7794/11288
|
2,2127,none,1570/7794/11288
|
||||||
|
#The Boys
|
||||||
1,18033,none,19531/25058
|
1,18033,none,19531/25058
|
||||||
|
#--------
|
||||||
|
#-----Mismatched Names------
|
||||||
99,3092,2605,none
|
99,3092,2605,none
|
||||||
99,50389,66832,none
|
99,50389,66832,none
|
||||||
99,42947,61242,none
|
99,42947,61242,none
|
||||||
|
|
|
|
@ -522,13 +522,23 @@ def dbcheck():
|
||||||
|
|
||||||
#new
|
#new
|
||||||
logger.info(u"Populating Exception listings into Mylar....")
|
logger.info(u"Populating Exception listings into Mylar....")
|
||||||
|
c.execute('DROP TABLE IF EXISTS exceptions')
|
||||||
|
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS exceptions (variloop TEXT, ComicID TEXT, NewComicID TEXT, GComicID TEXT)')
|
c.execute('CREATE TABLE IF NOT EXISTS exceptions (variloop TEXT, ComicID TEXT, NewComicID TEXT, GComicID TEXT)')
|
||||||
|
|
||||||
csvfile = open('exceptions.csv', "rb")
|
EXCEPTIONS_FILE = os.path.join(DATA_DIR, 'exceptions.csv')
|
||||||
|
|
||||||
|
if not os.path.exists(EXCEPTIONS_FILE):
|
||||||
|
try:
|
||||||
|
csvfile = open(str(EXCEPTIONS_FILE), "rb")
|
||||||
|
except OSError:
|
||||||
|
logger.error('Could not locate exceptions.csv file. Check in datadir: ' + DATA_DIR)
|
||||||
|
else:
|
||||||
|
csvfile = open(str(EXCEPTIONS_FILE), "rb")
|
||||||
|
|
||||||
creader = csv.reader(csvfile, delimiter=',')
|
creader = csv.reader(csvfile, delimiter=',')
|
||||||
|
|
||||||
for row in creader:
|
for row in creader:
|
||||||
#print (row)
|
|
||||||
try:
|
try:
|
||||||
c.execute("INSERT INTO exceptions VALUES (?,?,?,?);", row)
|
c.execute("INSERT INTO exceptions VALUES (?,?,?,?);", row)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
Loading…
Reference in a new issue