FIX:(#1694) Error occurs during refresh/add of series/arc if the series year on CV is in a XXXX- format to indicate a currently published series

This commit is contained in:
evilhero 2017-08-11 19:55:54 -04:00
parent dfe009f7fb
commit 5ee122a7df
2 changed files with 12 additions and 1 deletions

View File

@ -270,6 +270,10 @@ def GetComicInfo(comicid, dom, safechk=None):
except:
comic['ComicYear'] = '0000'
#safety check, cause you known, dufus'...
if comic['ComicYear'][-1:] == '-':
comic['ComicYear'] = comic['ComicYear'][:-1]
try:
comic['ComicURL'] = dom.getElementsByTagName('site_detail_url')[trackcnt].firstChild.wholeText
except:
@ -300,6 +304,9 @@ def GetComicInfo(comicid, dom, safechk=None):
try:
comic['Aliases'] = dom.getElementsByTagName('aliases')[0].firstChild.wholeText
comic['Aliases'] = re.sub('\n', '##', comic['Aliases']).strip()
if comic['Aliases'][-2:] == '##':
comic['Aliases'] = comic['Aliases'][:-2]
#logger.fdebug('Aliases: ' + str(aliases))
except:
comic['Aliases'] = 'None'
@ -586,6 +593,10 @@ def GetSeriesYears(dom):
logger.warn('There was a problem retrieving the start year for a particular series within the story arc.')
tempseries['SeriesYear'] = '0000'
#cause you know, dufus'...
if tempseries['SeriesYear'][-1:] == '-':
tempseries['SeriesYear'] = tempseries['SeriesYear'][:-1]
desdeck = 0
tempseries['Volume'] = 'None'

View File

@ -152,7 +152,7 @@ def addComictoDB(comicid, mismatch=None, pullupd=None, imported=None, ogcname=No
CV_NoYearGiven = "no"
#if the SeriesYear returned by CV is blank or none (0000), let's use the gcd one.
if comic['ComicYear'] is None or comic['ComicYear'] == '0000':
if any([comic['ComicYear'] is None, comic['ComicYear'] == '0000', comic['ComicYear'][-1:] == '-']):
if mylar.CV_ONLY:
#we'll defer this until later when we grab all the issues and then figure it out
logger.info('Uh-oh. I cannot find a Series Year for this series. I am going to try analyzing deeper.')