Private GIT

Skip to content
Snippets Groups Projects
Commit fcf152fb authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Simplify pickBestResult a bit, try to fix issue for @atj20

parent d4f534f0
No related branches found
No related tags found
No related merge requests found
...@@ -231,11 +231,13 @@ def pickBestResult(results, show): ...@@ -231,11 +231,13 @@ def pickBestResult(results, show):
logger.log(cur_result.name + u" has previously failed, rejecting it") logger.log(cur_result.name + u" has previously failed, rejecting it")
continue continue
if cur_result.quality in bestQualities and (not bestResult or bestResult.quality < cur_result.quality or bestResult not in bestQualities): if not bestResult:
bestResult = cur_result
elif cur_result.quality in bestQualities and (bestResult.quality < cur_result.quality or bestResult not in bestQualities):
bestResult = cur_result bestResult = cur_result
elif cur_result.quality in anyQualities and (not bestResult or bestResult not in bestQualities) and (not bestResult or bestResult.quality < cur_result.quality): elif cur_result.quality in anyQualities and bestResult not in bestQualities and bestResult.quality < cur_result.quality:
bestResult = cur_result bestResult = cur_result
elif bestResult and bestResult.quality == cur_result.quality: elif bestResult.quality == cur_result.quality:
if "proper" in cur_result.name.lower() or "repack" in cur_result.name.lower(): if "proper" in cur_result.name.lower() or "repack" in cur_result.name.lower():
bestResult = cur_result bestResult = cur_result
elif "internal" in bestResult.name.lower() and "internal" not in cur_result.name.lower(): elif "internal" in bestResult.name.lower() and "internal" not in cur_result.name.lower():
...@@ -589,11 +591,11 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False): ...@@ -589,11 +591,11 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False):
# go through multi-ep results and see if we really want them or not, get rid of the rest # go through multi-ep results and see if we really want them or not, get rid of the rest
multiResults = {} multiResults = {}
if MULTI_EP_RESULT in foundResults[curProvider.name]: if MULTI_EP_RESULT in foundResults[curProvider.name]:
for multiResult in foundResults[curProvider.name][MULTI_EP_RESULT]: for _multiResult in foundResults[curProvider.name][MULTI_EP_RESULT]:
logger.log(u"Seeing if we want to bother with multi-episode result " + multiResult.name, logger.DEBUG) logger.log(u"Seeing if we want to bother with multi-episode result " + multiResult.name, logger.DEBUG)
multiResult = pickBestResult([multiResult], show) multiResult = pickBestResult(_multiResult, show)
if not multiResult: if not multiResult:
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment