mirror of
https://github.com/evilhero/mylar
synced 2025-02-22 05:50:34 +00:00
FIX: Post-processing was not properly detecting annuals
This commit is contained in:
parent
6df8976f73
commit
a0ebd3ad7e
2 changed files with 16 additions and 6 deletions
|
@ -344,6 +344,8 @@ class PostProcessor(object):
|
||||||
logger.info('%s Alternate series naming detected: %s' % (module, fl['alt_series']))
|
logger.info('%s Alternate series naming detected: %s' % (module, fl['alt_series']))
|
||||||
as_sinfo = as_d.dynamic_replace(helpers.conversion(fl['alt_series']))
|
as_sinfo = as_d.dynamic_replace(helpers.conversion(fl['alt_series']))
|
||||||
mod_altseriesname = as_sinfo['mod_seriesname']
|
mod_altseriesname = as_sinfo['mod_seriesname']
|
||||||
|
if all([mylar.CONFIG.ANNUALS_ON, 'annual' in mod_altseriesname.lower()]):
|
||||||
|
mod_altseriesname = re.sub('annual', '', mod_altseriesname, flags=re.I).strip()
|
||||||
if not any(re.sub('[\|\s]', '', mod_altseriesname).lower() == x for x in loopchk):
|
if not any(re.sub('[\|\s]', '', mod_altseriesname).lower() == x for x in loopchk):
|
||||||
loopchk.append(re.sub('[\|\s]', '', mod_altseriesname.lower()))
|
loopchk.append(re.sub('[\|\s]', '', mod_altseriesname.lower()))
|
||||||
|
|
||||||
|
@ -362,6 +364,7 @@ class PostProcessor(object):
|
||||||
#make sure we add back in the original parsed filename here.
|
#make sure we add back in the original parsed filename here.
|
||||||
if not any(re.sub('[\|\s]', '', mod_seriesname).lower() == x for x in loopchk):
|
if not any(re.sub('[\|\s]', '', mod_seriesname).lower() == x for x in loopchk):
|
||||||
loopchk.append(re.sub('[\|\s]', '', mod_seriesname.lower()))
|
loopchk.append(re.sub('[\|\s]', '', mod_seriesname.lower()))
|
||||||
|
|
||||||
tmpsql = "SELECT * FROM comics WHERE DynamicComicName IN ({seq}) COLLATE NOCASE".format(seq=','.join('?' * len(loopchk)))
|
tmpsql = "SELECT * FROM comics WHERE DynamicComicName IN ({seq}) COLLATE NOCASE".format(seq=','.join('?' * len(loopchk)))
|
||||||
comicseries = myDB.select(tmpsql, tuple(loopchk))
|
comicseries = myDB.select(tmpsql, tuple(loopchk))
|
||||||
|
|
||||||
|
@ -588,6 +591,7 @@ class PostProcessor(object):
|
||||||
logger.fdebug(module + '[SUCCESSFUL MATCH: ' + cs['ComicName'] + '-' + cs['ComicID'] + '] Match verified for ' + helpers.conversion(fl['comicfilename']))
|
logger.fdebug(module + '[SUCCESSFUL MATCH: ' + cs['ComicName'] + '-' + cs['ComicID'] + '] Match verified for ' + helpers.conversion(fl['comicfilename']))
|
||||||
continue #break
|
continue #break
|
||||||
|
|
||||||
|
|
||||||
mlp = []
|
mlp = []
|
||||||
|
|
||||||
xmld = filechecker.FileChecker()
|
xmld = filechecker.FileChecker()
|
||||||
|
|
|
@ -907,7 +907,6 @@ class FileChecker(object):
|
||||||
|
|
||||||
#if the filename is unicoded, it won't match due to the unicode translation. Keep the unicode as well as the decoded.
|
#if the filename is unicoded, it won't match due to the unicode translation. Keep the unicode as well as the decoded.
|
||||||
series_name_decoded= unicodedata.normalize('NFKD', helpers.conversion(series_name)).encode('ASCII', 'ignore')
|
series_name_decoded= unicodedata.normalize('NFKD', helpers.conversion(series_name)).encode('ASCII', 'ignore')
|
||||||
|
|
||||||
#check for annual in title(s) here.
|
#check for annual in title(s) here.
|
||||||
if not self.justparse and mylar.CONFIG.ANNUALS_ON and 'annual' not in self.watchcomic.lower():
|
if not self.justparse and mylar.CONFIG.ANNUALS_ON and 'annual' not in self.watchcomic.lower():
|
||||||
if 'annual' in series_name.lower():
|
if 'annual' in series_name.lower():
|
||||||
|
@ -966,6 +965,7 @@ class FileChecker(object):
|
||||||
|
|
||||||
def matchIT(self, series_info):
|
def matchIT(self, series_info):
|
||||||
series_name = series_info['series_name']
|
series_name = series_info['series_name']
|
||||||
|
alt_series = series_info['alt_series']
|
||||||
filename = series_info['comicfilename']
|
filename = series_info['comicfilename']
|
||||||
#compare here - match comparison against u_watchcomic.
|
#compare here - match comparison against u_watchcomic.
|
||||||
#logger.fdebug('Series_Name: ' + series_name + ' --- WatchComic: ' + self.watchcomic)
|
#logger.fdebug('Series_Name: ' + series_name + ' --- WatchComic: ' + self.watchcomic)
|
||||||
|
@ -974,11 +974,13 @@ class FileChecker(object):
|
||||||
mod_seriesname = mod_dynamicinfo['mod_seriesname']
|
mod_seriesname = mod_dynamicinfo['mod_seriesname']
|
||||||
mod_watchcomic = mod_dynamicinfo['mod_watchcomic']
|
mod_watchcomic = mod_dynamicinfo['mod_watchcomic']
|
||||||
mod_altseriesname = None
|
mod_altseriesname = None
|
||||||
|
mod_altseriesname_decoded = None
|
||||||
#logger.fdebug('series_info: %s' % series_info)
|
#logger.fdebug('series_info: %s' % series_info)
|
||||||
if series_info['alt_series'] is not None:
|
if series_info['alt_series'] is not None:
|
||||||
mod_dynamicalt = self.dynamic_replace(series_info['alt_series'])
|
mod_dynamicalt = self.dynamic_replace(alt_series)
|
||||||
mod_altseriesname = mod_dynamicalt['mod_seriesname']
|
mod_altseriesname = mod_dynamicalt['mod_seriesname']
|
||||||
|
mod_alt_decoded = self.dynamic_replace(alt_series)
|
||||||
|
mod_altseriesname_decoded = mod_alt_decoded['mod_seriesname']
|
||||||
#logger.fdebug('mod_altseriesname: %s' % mod_altseriesname)
|
#logger.fdebug('mod_altseriesname: %s' % mod_altseriesname)
|
||||||
mod_series_decoded = self.dynamic_replace(series_info['series_name_decoded'])
|
mod_series_decoded = self.dynamic_replace(series_info['series_name_decoded'])
|
||||||
mod_seriesname_decoded = mod_series_decoded['mod_seriesname']
|
mod_seriesname_decoded = mod_series_decoded['mod_seriesname']
|
||||||
|
@ -991,6 +993,7 @@ class FileChecker(object):
|
||||||
nspace_altseriesname = None
|
nspace_altseriesname = None
|
||||||
if mod_altseriesname is not None:
|
if mod_altseriesname is not None:
|
||||||
nspace_altseriesname = re.sub(' ', '', mod_altseriesname)
|
nspace_altseriesname = re.sub(' ', '', mod_altseriesname)
|
||||||
|
nspace_altseriesname_decoded = re.sub(' ', '', mod_altseriesname_decoded)
|
||||||
nspace_seriesname_decoded = re.sub(' ', '', mod_seriesname_decoded)
|
nspace_seriesname_decoded = re.sub(' ', '', mod_seriesname_decoded)
|
||||||
nspace_watchname_decoded = re.sub(' ', '', mod_watchname_decoded)
|
nspace_watchname_decoded = re.sub(' ', '', mod_watchname_decoded)
|
||||||
|
|
||||||
|
@ -1005,10 +1008,13 @@ class FileChecker(object):
|
||||||
if mylar.CONFIG.ANNUALS_ON and 'annual' not in nspace_watchcomic.lower():
|
if mylar.CONFIG.ANNUALS_ON and 'annual' not in nspace_watchcomic.lower():
|
||||||
if 'annual' in series_name.lower():
|
if 'annual' in series_name.lower():
|
||||||
justthedigits = 'Annual ' + series_info['issue_number']
|
justthedigits = 'Annual ' + series_info['issue_number']
|
||||||
nspace_seriesname = re.sub('annual', '', nspace_seriesname.lower()).strip()
|
nspace_seriesname = re.sub('annual', '', nspace_seriesname.lower()).strip()
|
||||||
nspace_seriesname_decoded = re.sub('annual', '', nspace_seriesname_decoded.lower()).strip()
|
nspace_seriesname_decoded = re.sub('annual', '', nspace_seriesname_decoded.lower()).strip()
|
||||||
|
if alt_series is not None and 'annual' in alt_series.lower():
|
||||||
|
nspace_altseriesname = re.sub('annual', '', nspace_altseriesname.lower()).strip()
|
||||||
|
nspace_altseriesname_decoded = re.sub('annual', '', nspace_altseriesname_decoded.lower()).strip()
|
||||||
seriesalt = False
|
seriesalt = False
|
||||||
|
|
||||||
if nspace_altseriesname is not None:
|
if nspace_altseriesname is not None:
|
||||||
if re.sub('\|','', nspace_altseriesname.lower()).strip() == re.sub('\|', '', nspace_watchcomic.lower()).strip():
|
if re.sub('\|','', nspace_altseriesname.lower()).strip() == re.sub('\|', '', nspace_watchcomic.lower()).strip():
|
||||||
seriesalt = True
|
seriesalt = True
|
||||||
|
|
Loading…
Reference in a new issue