mirror of
https://github.com/evilhero/mylar
synced 2025-02-02 12:31:44 +00:00
FIX: When using Experimental Search, would error out when parsing results due to filesize addition, IMP: Removed 'Experimental Only' from tite in configuration File-Size Search Restrictions
This commit is contained in:
parent
7000e880cf
commit
ff198c75fc
2 changed files with 24 additions and 21 deletions
|
@ -421,7 +421,7 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Restrictions (only with Experimental ATM)</legend>
|
||||
<legend>File-Size Search Restrictions</legend>
|
||||
<div class="row checkbox left">
|
||||
<input id="use_minsize" type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" onclick="initConfigCheckbox($(this));" name="use_minsize" value="1" ${config['use_minsize']} /><label>Minimum File size<small>(MB)</small></label>
|
||||
</div>
|
||||
|
|
|
@ -437,10 +437,29 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
else:
|
||||
for entry in bb['entries']:
|
||||
logger.fdebug("checking search result: " + str(entry['title']))
|
||||
tmpsz = entry.enclosures[0]
|
||||
comsize_b = tmpsz['length']
|
||||
comsize_m = helpers.human_size(comsize_b)
|
||||
logger.fdebug("size given as: " + str(comsize_m))
|
||||
if nzbprov != "experimental":
|
||||
#Experimental already has size constraints done.
|
||||
tmpsz = entry.enclosures[0]
|
||||
comsize_b = tmpsz['length']
|
||||
comsize_m = helpers.human_size(comsize_b)
|
||||
logger.fdebug("size given as: " + str(comsize_m))
|
||||
#----size constraints.
|
||||
#if it's not within size constaints - dump it now and save some time.
|
||||
logger.fdebug("size : " + str(comsize_m))
|
||||
if mylar.USE_MINSIZE:
|
||||
conv_minsize = helpers.human2bytes(mylar.MINSIZE + "M")
|
||||
logger.fdebug("comparing Min threshold " + str(conv_minsize) + " .. to .. nzb " + str(comsize_b))
|
||||
if int(conv_minsize) > int(comsize_b):
|
||||
logger.fdebug("Failure to meet the Minimum size threshold - skipping")
|
||||
continue
|
||||
if mylar.USE_MAXSIZE:
|
||||
conv_maxsize = helpers.human2bytes(mylar.MAXSIZE + "M")
|
||||
logger.fdebug("comparing Max threshold " + str(conv_maxsize) + " .. to .. nzb " + str(comsize_b))
|
||||
if int(comsize_b) > int(conv_maxsize):
|
||||
logger.fdebug("Failure to meet the Maximium size threshold - skipping")
|
||||
continue
|
||||
|
||||
# -- end size constaints.
|
||||
|
||||
thisentry = str(entry['title'])
|
||||
logger.fdebug("Entry: " + str(thisentry))
|
||||
|
@ -466,23 +485,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
logger.fdebug("invalid nzb and/or cover only - skipping.")
|
||||
cleantitle = "abcdefghijk 0 (1901).cbz"
|
||||
continue
|
||||
#----size constraints.
|
||||
#if it's not within size constaints - dump it now and save some time.
|
||||
logger.fdebug("size : " + str(comsize_m))
|
||||
if mylar.USE_MINSIZE:
|
||||
conv_minsize = helpers.human2bytes(mylar.MINSIZE + "M")
|
||||
logger.fdebug("comparing Min threshold " + str(conv_minsize) + " .. to .. nzb " + str(comsize_b))
|
||||
if int(conv_minsize) > int(comsize_b):
|
||||
logger.fdebug("Failure to meet the Minimum size threshold - skipping")
|
||||
continue
|
||||
if mylar.USE_MAXSIZE:
|
||||
conv_maxsize = helpers.human2bytes(mylar.MAXSIZE + "M")
|
||||
logger.fdebug("comparing Max threshold " + str(conv_maxsize) + " .. to .. nzb " + str(comsize_b))
|
||||
if int(comsize_b) > int(conv_maxsize):
|
||||
logger.fdebug("Failure to meet the Maximium size threshold - skipping")
|
||||
continue
|
||||
|
||||
# -- end size constaints.
|
||||
if done:
|
||||
break
|
||||
#let's narrow search down - take out year (2010), (2011), etc
|
||||
|
|
Loading…
Reference in a new issue