From b2683511788c9eeb55bdb074680b7beccaac30e6 Mon Sep 17 00:00:00 2001 From: evilhero Date: Tue, 5 Mar 2019 15:11:21 -0500 Subject: [PATCH] FIX: fix for .HU issue numbering not being accounted for / displayed due to invalid numeric --- mylar/PostProcessor.py | 3 +++ mylar/filechecker.py | 2 +- mylar/helpers.py | 6 ++++++ mylar/importer.py | 2 ++ mylar/webserve.py | 6 +++--- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mylar/PostProcessor.py b/mylar/PostProcessor.py index f5891d47..b2e6af87 100755 --- a/mylar/PostProcessor.py +++ b/mylar/PostProcessor.py @@ -2067,6 +2067,9 @@ class PostProcessor(object): elif 'mu' in issuenum.lower() and issuenum[:1].isdigit(): issuenum = re.sub("[^0-9]", "", issuenum) issue_except = '.MU' + elif 'hu' in issuenum.lower() and issuenum[:1].isdigit(): + issuenum = re.sub("[^0-9]", "", issuenum) + issue_except = '.HU' elif u'\xbd' in issuenum: issuenum = '0.5' elif u'\xbc' in issuenum: diff --git a/mylar/filechecker.py b/mylar/filechecker.py index a8b9b877..01ef7d1a 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -408,7 +408,7 @@ class FileChecker(object): lastmod_position = 0 booktype = 'issue' #exceptions that are considered alpha-numeric issue numbers - exceptions = ('NOW', 'AI', 'AU', 'X', 'A', 'B', 'C', 'INH', 'MU', 'SUMMER', 'SPRING', 'FALL', 'WINTER') + exceptions = ('NOW', 'AI', 'AU', 'X', 'A', 'B', 'C', 'INH', 'MU', 'HU', 'SUMMER', 'SPRING', 'FALL', 'WINTER') #unicode characters, followed by int value # num_exceptions = [{iss:u'\xbd',val:.5},{iss:u'\xbc',val:.25}, {iss:u'\xe',val:.75}, {iss:u'\221e',val:'infinity'}] diff --git a/mylar/helpers.py b/mylar/helpers.py index b8f43029..98cbcfeb 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -990,6 +990,12 @@ def issuedigits(issnum): int_issnum = (int(issnum[:-2]) * 1000) + ord('m') + ord('u') else: int_issnum = (int(issnum[:-3]) * 1000) + ord('m') + ord('u') + elif 'hu' in issnum.lower(): + remdec = issnum.find('.') #find the decimal position. + if remdec == -1: + int_issnum = (int(issnum[:-2]) * 1000) + ord('h') + ord('u') + else: + int_issnum = (int(issnum[:-3]) * 1000) + ord('h') + ord('u') except ValueError as e: logger.error('[' + issnum + '] Unable to properly determine the issue number. Error: %s', e) diff --git a/mylar/importer.py b/mylar/importer.py index 6bea2316..bcf34a93 100644 --- a/mylar/importer.py +++ b/mylar/importer.py @@ -1127,6 +1127,8 @@ def updateissuedata(comicid, comicname=None, issued=None, comicIssues=None, call int_issnum = (int(issnum[:-4]) * 1000) + ord('n') + ord('o') + ord('w') elif 'mu' in issnum.lower(): int_issnum = (int(issnum[:-3]) * 1000) + ord('m') + ord('u') + elif 'hu' in issnum.lower(): + int_issnum = (int(issnum[:-3]) * 1000) + ord('h') + ord('u') elif u'\xbd' in issnum: int_issnum = .5 * 1000 logger.fdebug('1/2 issue detected :' + issnum + ' === ' + str(int_issnum)) diff --git a/mylar/webserve.py b/mylar/webserve.py index 63fb86cc..2f21dc08 100644 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -1695,7 +1695,7 @@ class WebInterface(object): try: x = float(weekly['ISSUE']) except ValueError, e: - if 'au' in weekly['ISSUE'].lower() or 'ai' in weekly['ISSUE'].lower() or '.inh' in weekly['ISSUE'].lower() or '.now' in weekly['ISSUE'].lower() or '.mu' in weekly['ISSUE'].lower(): + if 'au' in weekly['ISSUE'].lower() or 'ai' in weekly['ISSUE'].lower() or '.inh' in weekly['ISSUE'].lower() or '.now' in weekly['ISSUE'].lower() or '.mu' in weekly['ISSUE'].lower() or '.hu' in weekly['ISSUE'].lower(): x = weekly['ISSUE'] if x is not None: @@ -1838,7 +1838,7 @@ class WebInterface(object): try: x = float(future['ISSUE']) except ValueError, e: - if 'au' in future['ISSUE'].lower() or 'ai' in future['ISSUE'].lower() or '.inh' in future['ISSUE'].lower() or '.now' in future['ISSUE'].lower() or '.mu' in future['ISSUE'].lower(): + if 'au' in future['ISSUE'].lower() or 'ai' in future['ISSUE'].lower() or '.inh' in future['ISSUE'].lower() or '.now' in future['ISSUE'].lower() or '.mu' in future['ISSUE'].lower() or '.hu' in future['ISSUE'].lower(): x = future['ISSUE'] if future['EXTRA'] == 'N/A' or future['EXTRA'] == '': @@ -5953,7 +5953,7 @@ class WebInterface(object): try: x = float(weekly['ISSUE']) except ValueError, e: - if 'au' in weekly['ISSUE'].lower() or 'ai' in weekly['ISSUE'].lower() or '.inh' in weekly['ISSUE'].lower() or '.now' in weekly['ISSUE'].lower() or '.mu' in weekly['ISSUE'].lower(): + if 'au' in weekly['ISSUE'].lower() or 'ai' in weekly['ISSUE'].lower() or '.inh' in weekly['ISSUE'].lower() or '.now' in weekly['ISSUE'].lower() or '.mu' in weekly['ISSUE'].lower() or '.hu' in weekly['ISSUE'].lower(): x = weekly['ISSUE'] if x is not None: