diff --git a/mylar/cv.py b/mylar/cv.py index 473171ba..91c6b28d 100755 --- a/mylar/cv.py +++ b/mylar/cv.py @@ -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' diff --git a/mylar/importer.py b/mylar/importer.py index 0f9347b6..f62b5124 100644 --- a/mylar/importer.py +++ b/mylar/importer.py @@ -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.')