From 4a9af8e19d3ff4012a9adb903b348f1a80c5344c Mon Sep 17 00:00:00 2001 From: evilhero Date: Sun, 23 Mar 2014 03:10:23 -0400 Subject: [PATCH] FIX:(#652) NZBMegaSearch would error out on searches due to date comparison error, IMP: Removed some spam console logging when unknown issues discovered. --- mylar/filechecker.py | 4 ++-- mylar/search.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mylar/filechecker.py b/mylar/filechecker.py index be5b4639..dcd86b98 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -495,11 +495,11 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non x = float(justthedigits) #validity check if x < 0: - logger.info("I've encountered a negative issue #: " + str(justthedigits) + ". Trying to accomodate.") + logger.fdebug("I've encountered a negative issue #: " + str(justthedigits) + ". Trying to accomodate.") digitsvalid = "true" else: raise ValueError except ValueError, e: - logger.info('Cannot determine issue number from given issue #: ' + str(justthedigits)) + logger.fdebug('Probably due to an incorrect match - I cannot determine the issue number from given issue #: ' + str(justthedigits)) # else: diff --git a/mylar/search.py b/mylar/search.py index f01b1e9a..8d5dccde 100755 --- a/mylar/search.py +++ b/mylar/search.py @@ -729,8 +729,13 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa #logger.fdebug('Posting date of : ' + str(pubdate)) # convert it to a tuple dateconv = email.utils.parsedate_tz(pubdate) + #logger.fdebug('dateconv of : ' + str(dateconv)) # convert it to a numeric time, then subtract the timezone difference (+/- GMT) - postdate_int = time.mktime(dateconv[:len(dateconv)-1]) - dateconv[-1] + if dateconv[-1] is not None: + postdate_int = time.mktime(dateconv[:len(dateconv)-1]) - dateconv[-1] + else: + postdate_int = time.mktime(dateconv[:len(dateconv)-1]) + #logger.fdebug('postdate_int of : ' + str(postdate_int)) #logger.fdebug('Issue date of : ' + str(stdate)) #convert it to a Thu, 06 Feb 2014 00:00:00 format issue_convert = datetime.datetime.strptime(stdate.rstrip(), '%Y-%m-%d')