Fixed some problems loading exceptions, included some details in csv file now

This commit is contained in:
evilhero 2012-10-17 11:56:09 -04:00
parent 5fb5e56532
commit dd96a80a18
2 changed files with 31 additions and 2 deletions

View File

@ -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
#Amazing Spider-man
2,2127,none,1570/7794/11288
#The Boys
1,18033,none,19531/25058
#--------
#-----Mismatched Names------
99,3092,2605,none
99,50389,66832,none
99,42947,61242,none

1 4 #Mylar Exception listings 2045 none 1482/10251/6029/11218/62349
1 #Mylar Exception listings
2 # In an effort to map ComicVine to GCD correctly, use this.
3 #----
4 #Required Format : code, ComicVineID, GCDComicID, GCDComicIDs (for volume spanning series)
5 #----Format Breakdown
6 #code = # of volumes in series to be checked minus 1 (if there are 4 volumes in a series, put 3)
7 = 99 is mismatched names. If a series won't match on GCD, this is what you would put.
8 #ComicVineID = the ComicVineID (taken from the searchresults, or the ..Loading.. detail screen)
9 #GCDComicID = the correct GCD Comic ID that Mylar is to match with.
10 #GCDComicIDs = put the GCD Comic ID's here for the given multiple volume spanning series seperated by a '/'
11 #use 'none' if you are not using an option (yes, it's necessary)
12 #--------
13 #--------
14 #-----Volume Spanning Series-----
15 #Fantastic Four
16 4 4,2045,none,1482/10251/6029/11218/62349 2045 none 1482/10251/6029/11218/62349
17 #Amazing Spider-man
18 2 2,2127,none,1570/7794/11288 2127 none 1570/7794/11288
19 #The Boys
20 1 1,18033,none,19531/25058 18033 none 19531/25058
21 #--------
22 #-----Mismatched Names------
23 99 99,3092,2605,none 3092 2605 none
24 99 99,50389,66832,none 50389 66832 none
25 99 99,42947,61242,none 42947 61242 none

View File

@ -522,13 +522,23 @@ def dbcheck():
#new
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)')
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=',')
for row in creader:
#print (row)
try:
c.execute("INSERT INTO exceptions VALUES (?,?,?,?);", row)
except Exception, e: