FIX: When Rechecking series that are One-Shots, and the filename did not contain an issue number would cause an error and not scan in, FIX: if a Special did not contain an issue number (ie. One-Shot), would fail during parsing

This commit is contained in:
evilhero 2019-01-14 10:54:54 -05:00
parent 313f60195d
commit 82bd567c32
2 changed files with 30 additions and 14 deletions

View File

@ -1149,7 +1149,9 @@ class FileChecker(object):
if mylar.CONFIG.ANNUALS_ON and 'special' not in nspace_watchcomic.lower():
if 'special' in series_name.lower():
justthedigits = 'Special ' + series_info['issue_number']
justthedigits = 'Special'
if series_info['issue_number'] is not None:
justthedigits += ' %s' % series_info['issue_number']
nspace_seriesname = re.sub('special', '', nspace_seriesname.lower()).strip()
nspace_seriesname_decoded = re.sub('special', '', nspace_seriesname_decoded.lower()).strip()
if alt_series is not None and 'special' in alt_series.lower():

View File

@ -933,7 +933,10 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False):
altnames = ''
if (all([rescan['Type'] != 'Print', rescan['Type'] != 'Digital', rescan['Type'] != 'None', rescan['Type'] is not None]) and rescan['Corrected_Type'] != 'Print') or rescan['Corrected_Type'] == 'TPB':
booktype = 'TPB'
if rescan['Type'] == 'One-Shot' and rescan['Corrected_Type'] is None:
booktype = 'One-Shot'
else:
booktype = 'TPB'
else:
booktype = None
@ -990,15 +993,23 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False):
cla = ca['comiclist'][i]
except (IndexError, KeyError) as e:
break
if booktype == 'TPB' and iscnt > 1:
just_the_digits = re.sub('[^0-9]', '', cla['SeriesVolume']).strip()
try:
if all([booktype == 'TPB', iscnt > 1]) or all([booktype == 'One-Shot', iscnt == 1]):
if cla['SeriesVolume'] is not None:
just_the_digits = re.sub('[^0-9]', '', cla['SeriesVolume']).strip()
else:
just_the_digits = re.sub('[^0-9]', '', cla['JusttheDigits']).strip()
else:
just_the_digits = cla['JusttheDigits']
except Exception as e:
logger.warn('[Exception: %s] Unable to properly match up/retrieve issue number (or volume) for this [CS: %s]' % (e,cla))
else:
just_the_digits = cla['JusttheDigits']
fcb.append({"ComicFilename": cla['ComicFilename'],
"ComicLocation": cla['ComicLocation'],
"ComicSize": cla['ComicSize'],
"JusttheDigits": just_the_digits,
"AnnualComicID": cla['AnnualComicID']})
fcb.append({"ComicFilename": cla['ComicFilename'],
"ComicLocation": cla['ComicLocation'],
"ComicSize": cla['ComicSize'],
"JusttheDigits": just_the_digits,
"AnnualComicID": cla['AnnualComicID']})
i+=1
fc['comiclist'] = fcb
@ -1082,10 +1093,13 @@ def forceRescan(ComicID, archive=None, module=None, recheck=False):
return
else:
break
temploc = tmpfc['JusttheDigits'].replace('_', ' ')
temploc = re.sub('[\#\']', '', temploc)
logger.fdebug(module + ' temploc: ' + temploc)
if tmpfc['JusttheDigits'] is not None:
temploc= tmpfc['JusttheDigits'].replace('_', ' ')
temploc = re.sub('[\#\']', '', temploc)
logger.fdebug('temploc: %s' % temploc)
else:
temploc = None
if all(['annual' not in temploc.lower(), 'special' not in temploc.lower()]):
#remove the extension here
extensions = ('.cbr', '.cbz', '.cb7')