mirror of
https://github.com/evilhero/mylar
synced 2025-02-01 12:07:50 +00:00
FIX: Experimental searches would not honour one-shot issues being searched without an issue number
This commit is contained in:
parent
40b466c31e
commit
041231a74b
2 changed files with 21 additions and 9 deletions
|
@ -10,7 +10,7 @@ import mylar
|
|||
import unicodedata
|
||||
import urllib
|
||||
|
||||
def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix):
|
||||
def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix, booktype=None):
|
||||
cName = searchName
|
||||
|
||||
#clean up searchName due to webparse/redudant naming that would return too specific of results.
|
||||
|
@ -39,7 +39,12 @@ def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix):
|
|||
encodeSearch = urllib.quote_plus(searchName)
|
||||
splitSearch = encodeSearch.split(" ")
|
||||
|
||||
if len(searchIssue) == 1:
|
||||
tmpsearchIssue = searchIssue
|
||||
|
||||
if any([booktype == 'One-Shot', booktype == 'TPB']):
|
||||
tmpsearchIssue = '1'
|
||||
loop = 4
|
||||
elif len(searchIssue) == 1:
|
||||
loop = 3
|
||||
elif len(searchIssue) == 2:
|
||||
loop = 2
|
||||
|
@ -71,17 +76,24 @@ def Startit(searchName, searchIssue, searchYear, ComicVersion, IssDateFix):
|
|||
i = 1
|
||||
while (i <= loop):
|
||||
if i == 1:
|
||||
searchmethod = searchIssue
|
||||
searchmethod = tmpsearchIssue
|
||||
elif i == 2:
|
||||
searchmethod = '0' + searchIssue
|
||||
searchmethod = '0' + tmpsearchIssue
|
||||
elif i == 3:
|
||||
searchmethod = '00' + searchIssue
|
||||
searchmethod = '00' + tmpsearchIssue
|
||||
elif i == 4:
|
||||
searchmethod = tmpsearchIssue
|
||||
else:
|
||||
break
|
||||
|
||||
joinSearch = "+".join(splitSearch) + "+" +searchmethod
|
||||
if i == 4:
|
||||
logger.fdebug('Now searching experimental for %s to try and ensure all the bases are covered' % cName)
|
||||
joinSearch = "+".join(splitSearch)
|
||||
else:
|
||||
logger.fdebug('Now searching experimental for issue number: %s to try and ensure all the bases are covered' % searchmethod)
|
||||
joinSearch = "+".join(splitSearch) + "+" +searchmethod
|
||||
|
||||
|
||||
logger.fdebug('Now searching experimental for issue number: %s to try and ensure all the bases are covered' % searchmethod)
|
||||
|
||||
if mylar.CONFIG.PREFERRED_QUALITY == 1: joinSearch = joinSearch + " .cbr"
|
||||
elif mylar.CONFIG.PREFERRED_QUALITY == 2: joinSearch = joinSearch + " .cbz"
|
||||
|
|
|
@ -651,7 +651,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
|
|||
if ComicName[:17] == '0-Day Comics Pack':
|
||||
searchterm = {'series': ComicName, 'issue': StoreDate[8:10], 'volume': StoreDate[5:7], 'torrentid_32p': None}
|
||||
else:
|
||||
searchterm = {'series': ComicName, 'id': ComicID, 'issue': findcomiciss, 'volume': ComicVersion, 'publisher': Publisher, 'torrentid_32p': torrentid_32p}
|
||||
searchterm = {'series': ComicName, 'id': ComicID, 'issue': findcomiciss, 'volume': ComicVersion, 'publisher': Publisher, 'torrentid_32p': torrentid_32p, 'booktype': booktype}
|
||||
#first we find the id on the serieslist of 32P
|
||||
#then we call the ajax against the id and issue# and volume (if exists)
|
||||
a = auth32p.info32p(searchterm=searchterm)
|
||||
|
@ -805,7 +805,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
|
|||
elif nzbprov == 'experimental':
|
||||
#bb = parseit.MysterBinScrape(comsearch[findloop], comyear)
|
||||
logger.info('sending %s to experimental search' % findcomic)
|
||||
bb = findcomicfeed.Startit(findcomic, isssearch, comyear, ComicVersion, IssDateFix)
|
||||
bb = findcomicfeed.Startit(findcomic, isssearch, comyear, ComicVersion, IssDateFix, booktype)
|
||||
# since the regexs in findcomicfeed do the 3 loops, lets force the exit after
|
||||
cmloopit == 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue