FIX: if refresh series would fail, creates None values for latest date that causes problems thereafter

This commit is contained in:
evilhero 2018-02-18 11:14:59 -05:00
parent cfdacb4501
commit f2d4926947
1 changed files with 19 additions and 15 deletions

View File

@ -1187,6 +1187,7 @@ def latestdate_fix():
"comicname_filesafe": filesafe(cl['ComicName'])})
latestdate = cl['LatestDate']
#logger.fdebug("latestdate: " + str(latestdate))
try:
if latestdate[8:] == '':
#logger.fdebug("invalid date " + str(latestdate) + " appending 01 for day to avoid errors")
if len(latestdate) <= 7:
@ -1203,6 +1204,9 @@ def latestdate_fix():
datefix.append({"comicid": cl['ComicID'],
"latestdate": latestdate})
#logger.info('latest date: ' + str(latestdate))
except:
datefix.append({"comicid": cl['ComicID'],
"latestdate" '0000-00-00'})
#now we fix.
if len(datefix) > 0: