mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00:00
Fix infinite loop with dognzb
This commit is contained in:
parent
84fe52bdf8
commit
1317848782
1 changed files with 13 additions and 3 deletions
|
@ -239,6 +239,18 @@ class NewznabProvider(generic.NZBProvider):
|
||||||
except (AttributeError, TypeError):
|
except (AttributeError, TypeError):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
# sanity check - limiting at 10 at getting 1000 results in-case incorrect total parameter is reported
|
||||||
|
if params['limit'] > 1000:
|
||||||
|
logger.log("Excessive results for search, ending search", logger.WARNING)
|
||||||
|
break
|
||||||
|
|
||||||
|
# sanity check - total should remain constant
|
||||||
|
if offset != 0 and total != initial_total:
|
||||||
|
logger.log("Total number of items on newznab response changed, ending search", logger.DEBUG)
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
initial_total = total
|
||||||
|
|
||||||
# if there are more items available then the amount given in one call, grab some more
|
# if there are more items available then the amount given in one call, grab some more
|
||||||
if (total - params['limit']) > offset == params['offset']:
|
if (total - params['limit']) > offset == params['offset']:
|
||||||
params['offset'] += params['limit']
|
params['offset'] += params['limit']
|
||||||
|
@ -248,9 +260,7 @@ class NewznabProvider(generic.NZBProvider):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
# sanity check - limiting at 10 at getting 1000 results in-case incorrect total parameter is reported
|
|
||||||
if params['limit'] > 1000:
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue