FIX:(#652) NZBMegaSearch would error out on searches due to date comparison error, IMP: Removed some spam console logging when unknown issues discovered.

This commit is contained in:
evilhero 2014-03-23 03:10:23 -04:00
parent af41c43b4c
commit 4a9af8e19d
2 changed files with 8 additions and 3 deletions

View File

@ -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:

View File

@ -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')