Skip to content

Commit

Permalink
Tweaks in search.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandog committed Mar 2, 2016
1 parent 0b113d7 commit 65092bf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions sickbeard/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False, ma
"""
foundResults = {}
finalResults = []
finalResult = []

didSearch = False

Expand Down Expand Up @@ -564,12 +563,12 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False, ma
continue

# Update the cache if a manual search is being runned
# We would update this to insert backlog results as well
if manualSelect:
results = curProvider.cache.updateCache(searchResults[curEp])
if results:
# If we have at least a result from one provider, it's good enough to be marked as result
finalResult.append(results)
finalResults.append(results)
# Continue because we don't want to pick best results as we are running a manual search by user
continue

# pick the best season NZB
Expand Down Expand Up @@ -769,10 +768,8 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False, ma
# Remove provider from thread name before return results
threading.currentThread().name = origThreadName

if manualSelect is True:
if True in finalResult:
return True
else:
return False
if manualSelect:
# If results in manual search return True, else False
return any(finalResults)
else:
return finalResults

0 comments on commit 65092bf

Please sign in to comment.