1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-26 01:26:50 +00:00

FIX:(#801) When doing a force search, if Issue Date was 0000-00-00 would skip starting the search even if a Publication Date existed for the given issue.

This commit is contained in:
evilhero 2014-08-26 14:33:00 -04:00
parent 3188fc1228
commit 708ba2ccd2

View file

@ -921,6 +921,8 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
#account for possible version inclusion here and annual inclusions. #account for possible version inclusion here and annual inclusions.
cvers = "false" cvers = "false"
annualize = "false" annualize = "false"
scount = 0
if 'annual' in ComicName.lower(): if 'annual' in ComicName.lower():
logger.fdebug("IssueID of : " + str(IssueID) + " - This is an annual...let's adjust.") logger.fdebug("IssueID of : " + str(IssueID) + " - This is an annual...let's adjust.")
annualize = "true" annualize = "true"
@ -941,8 +943,57 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
else: else:
logger.fdebug("error - unknown length for : " + str(tstsplit)) logger.fdebug("error - unknown length for : " + str(tstsplit))
logger.fdebug("volume detection commencing - adjusting length.") logger.fdebug("volume detection commencing - adjusting length.")
logger.fdebug("watch comicversion is " + str(ComicVersion))
fndcomicversion = str(tstsplit)
logger.fdebug("version found: " + str(fndcomicversion))
logger.fdebug("vers4year: " + str(vers4year))
logger.fdebug("vers4vol: " + str(vers4vol))
if vers4year is not "no" or vers4vol is not "no":
#if the volume is None, assume it's a V1 to increase % hits
if ComVersChk == 0:
D_ComicVersion = 1
else:
D_ComicVersion = ComVersChk
F_ComicVersion = re.sub("[^0-9]", "", fndcomicversion)
#if this is a one-off, SeriesYear will be None and cause errors.
if SeriesYear is None:
S_ComicVersion = 0
else:
S_ComicVersion = str(SeriesYear)
logger.fdebug("FCVersion: " + str(F_ComicVersion))
logger.fdebug("DCVersion: " + str(D_ComicVersion))
logger.fdebug("SCVersion: " + str(S_ComicVersion))
#here's the catch, sometimes annuals get posted as the Pub Year
# instead of the Series they belong to (V2012 vs V2013)
if annualize == "true" and int(ComicYear) == int(F_ComicVersion):
logger.fdebug("We matched on versions for annuals " + str(fndcomicversion))
scount+=1
cvers = "true" cvers = "true"
splitst = splitst - 1
elif int(F_ComicVersion) == int(D_ComicVersion) or int(F_ComicVersion) == int(S_ComicVersion):
logger.fdebug("We matched on versions..." + str(fndcomicversion))
scount+=1
cvers = "true"
else:
logger.fdebug("Versions wrong. Ignoring possible match.")
scount = 0
cvers = "false"
if cvers == "true":
#since we matched on versions, let's remove it entirely to improve matching.
logger.fdebug('Removing versioning from nzb filename to improve matching algorithims.')
cissb4vers = re.sub(tstsplit, "", comic_iss_b4).strip()
logger.fdebug('New b4split : ' + str(cissb4vers))
splitit = cissb4vers.split(None)
splitst -=1
break break
#do an initial check #do an initial check
@ -982,7 +1033,6 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
else: else:
logger.fdebug("length match..proceeding") logger.fdebug("length match..proceeding")
n = 0 n = 0
scount = 0
logger.fdebug("search-length: " + str(splitst)) logger.fdebug("search-length: " + str(splitst))
logger.fdebug("Watchlist-length: " + str(len(watchcomic_split))) logger.fdebug("Watchlist-length: " + str(len(watchcomic_split)))
if cvers == "true": splitst = splitst + 1 if cvers == "true": splitst = splitst + 1
@ -999,45 +1049,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
#elif ':' in splitit[n] or '-' in splitit[n]: #elif ':' in splitit[n] or '-' in splitit[n]:
# splitrep = splitit[n].replace('-', '') # splitrep = splitit[n].replace('-', '')
# print ("non-character keyword...skipped on " + splitit[n]) # print ("non-character keyword...skipped on " + splitit[n])
elif str(splitit[n].lower()).startswith('v'):
logger.fdebug("possible versioning..checking")
#we hit a versioning # - account for it
if splitit[n][1:].isdigit():
logger.fdebug("watch comicversion is " + str(ComicVersion))
fndcomicversion = str(splitit[n])
logger.fdebug("version found: " + str(fndcomicversion))
logger.fdebug("vers4year: " + str(vers4year))
logger.fdebug("vers4vol: " + str(vers4vol))
if vers4year is not "no" or vers4vol is not "no":
#if the volume is None, assume it's a V1 to increase % hits
if ComVersChk == 0:
D_ComicVersion = 1
else:
D_ComicVersion = ComVersChk
F_ComicVersion = re.sub("[^0-9]", "", fndcomicversion)
#if this is a one-off, SeriesYear will be None and cause errors.
if SeriesYear is None:
S_ComicVersion = 0
else:
S_ComicVersion = str(SeriesYear)
logger.fdebug("FCVersion: " + str(F_ComicVersion))
logger.fdebug("DCVersion: " + str(D_ComicVersion))
logger.fdebug("SCVersion: " + str(S_ComicVersion))
#here's the catch, sometimes annuals get posted as the Pub Year
# instead of the Series they belong to (V2012 vs V2013)
if annualize == "true" and int(ComicYear) == int(F_ComicVersion):
logger.fdebug("We matched on versions for annuals " + str(fndcomicversion))
scount+=1
elif int(F_ComicVersion) == int(D_ComicVersion) or int(F_ComicVersion) == int(S_ComicVersion):
logger.fdebug("We matched on versions..." + str(fndcomicversion))
scount+=1
else:
logger.fdebug("Versions wrong. Ignoring possible match.")
scount = 0
else: else:
logger.fdebug("Comic / Issue section") logger.fdebug("Comic / Issue section")
if splitit[n].isdigit(): if splitit[n].isdigit():
@ -1193,8 +1205,9 @@ def searchforissue(issueid=None, new=False, rsscheck=None):
if comic is None: if comic is None:
logger.fdebug(str(result['ComicID']) + ' has no associated comic information. Skipping searching for this series.') logger.fdebug(str(result['ComicID']) + ' has no associated comic information. Skipping searching for this series.')
continue continue
if result['StoreDate'] == '0000-00-00': if result['StoreDate'] == '0000-00-00' or result['StoreDate'] is None:
logger.fdebug(str(result['ComicID']) + ' has an invalid Store Date. Skipping searching for this series.') if result['IssueDate'] is None or result['IssueDate'] == '0000-00-00':
logger.fdebug('ComicID: ' + str(result['ComicID']) + ' has invalid Date data. Skipping searching for this series.')
continue continue
foundNZB = "none" foundNZB = "none"
SeriesYear = comic['ComicYear'] SeriesYear = comic['ComicYear']