FIX:(#1349) Malformed string error when Mass Importing, FIX: When locating files to move/archive during an import run that have been detected with a ComicID, will now locate the files to reference by the ComicID instead of by name

This commit is contained in:
evilhero 2016-08-15 15:51:58 -04:00
parent 852baeb0f9
commit a84069d8d2
2 changed files with 10 additions and 9 deletions

View File

@ -8,7 +8,10 @@ def movefiles(comicid, comlocation, imported):
#comlocation is destination
#comicid is used for rename
files_moved = []
imported = ast.literal_eval(imported)
try:
imported = ast.literal_eval(imported)
except ValueError:
pass
myDB = db.DBConnection()
@ -65,7 +68,10 @@ def movefiles(comicid, comlocation, imported):
def archivefiles(comicid, comlocation, imported):
myDB = db.DBConnection()
# if move files isn't enabled, let's set all found comics to Archive status :)
imported = ast.literal_eval(imported)
try:
imported = ast.literal_eval(imported)
except ValueError:
pass
ComicName = imported['ComicName']
impres = imported['filelisting']

View File

@ -3282,12 +3282,7 @@ class WebInterface(object):
if comicinfo['ComicID'] is None or comicinfo['ComicID'] == 'None':
continue
else:
if any([comicinfo['Volume'] is None, comicinfo['Volume'] == 'None']):
results = myDB.select("SELECT * FROM importresults WHERE (WatchMatch is Null OR WatchMatch LIKE 'C%') AND DynamicName=? AND Volume IS NULL",[comicinfo['DynamicName']])
else:
if not comicinfo['Volume'].lower().startswith('v'):
volume = 'v' + str(comicinfo['Volume'])
results = myDB.select("SELECT * FROM importresults WHERE (WatchMatch is Null OR WatchMatch LIKE 'C%') AND DynamicName=? AND Volume=?",[comicinfo['DynamicName'],comicinfo['Volume']])
results = myDB.select("SELECT * FROM importresults WHERE (WatchMatch is Null OR WatchMatch LIKE 'C%') AND ComicID=?", [comicinfo['ComicID']])
files = []
for result in results:
files.append({'comicfilename': result['ComicFilename'],
@ -3311,7 +3306,7 @@ class WebInterface(object):
newVal = {"Status": 'Imported',
"SRID": SRID}
myDB.upsert("importresults", newVal, ctrlVal)
logger.info('Successfully imported :' + comicinfo['ComicName'])
logger.info('Successfully verified import sequence data for : ' + comicinfo['ComicName'] + '. Currently adding to your watchlist.')
RemoveIDS.append(comicinfo['ComicID'])
#we need to remove these items from the comiclist now, so they don't get processed again