mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 05:33:37 +00:00
Fix for no providers found error during searches.
This commit is contained in:
parent
f47734446d
commit
012baeda0c
2 changed files with 51 additions and 36 deletions
|
@ -40,6 +40,8 @@ class DailySearcher():
|
||||||
|
|
||||||
self.amActive = True
|
self.amActive = True
|
||||||
|
|
||||||
|
didSearch = False
|
||||||
|
|
||||||
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive() and not x.backlog_only]
|
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive() and not x.backlog_only]
|
||||||
for curProviderCount, curProvider in enumerate(providers):
|
for curProviderCount, curProvider in enumerate(providers):
|
||||||
|
|
||||||
|
@ -55,6 +57,9 @@ class DailySearcher():
|
||||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
didSearch = True
|
||||||
|
|
||||||
|
if didSearch:
|
||||||
logger.log(u"Searching for coming episodes and 1 weeks worth of previously WANTED episodes ...")
|
logger.log(u"Searching for coming episodes and 1 weeks worth of previously WANTED episodes ...")
|
||||||
|
|
||||||
fromDate = datetime.date.today() - datetime.timedelta(weeks=1)
|
fromDate = datetime.date.today() - datetime.timedelta(weeks=1)
|
||||||
|
@ -93,4 +98,9 @@ class DailySearcher():
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
myDB.mass_action(sql_l)
|
myDB.mass_action(sql_l)
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.log(
|
||||||
|
u"No NZB/Torrent providers found or enabled in the sickrage config. Please check your settings.",
|
||||||
|
logger.ERROR)
|
||||||
|
|
||||||
self.amActive = False
|
self.amActive = False
|
|
@ -340,6 +340,7 @@ def filterSearchResults(show, season, results):
|
||||||
|
|
||||||
def searchForNeededEpisodes(show, episodes):
|
def searchForNeededEpisodes(show, episodes):
|
||||||
foundResults = {}
|
foundResults = {}
|
||||||
|
|
||||||
didSearch = False
|
didSearch = False
|
||||||
|
|
||||||
origThreadName = threading.currentThread().name
|
origThreadName = threading.currentThread().name
|
||||||
|
@ -390,7 +391,7 @@ def searchForNeededEpisodes(show, episodes):
|
||||||
|
|
||||||
if not didSearch:
|
if not didSearch:
|
||||||
logger.log(
|
logger.log(
|
||||||
u"No NZB/Torrent providers found or enabled in the sickrage config. Please check your settings.",
|
u"No NZB/Torrent providers found or enabled in the sickrage config for daily searches. Please check your settings.",
|
||||||
logger.ERROR)
|
logger.ERROR)
|
||||||
|
|
||||||
return foundResults.values() if len(foundResults) else {}
|
return foundResults.values() if len(foundResults) else {}
|
||||||
|
@ -400,6 +401,8 @@ def searchProviders(show, season, episodes, manualSearch=False):
|
||||||
foundResults = {}
|
foundResults = {}
|
||||||
finalResults = []
|
finalResults = []
|
||||||
|
|
||||||
|
didSearch = False
|
||||||
|
|
||||||
# check if we want to search for season packs instead of just season/episode
|
# check if we want to search for season packs instead of just season/episode
|
||||||
seasonSearch = False
|
seasonSearch = False
|
||||||
if not manualSearch:
|
if not manualSearch:
|
||||||
|
@ -444,6 +447,8 @@ def searchProviders(show, season, episodes, manualSearch=False):
|
||||||
finally:
|
finally:
|
||||||
threading.currentThread().name = origThreadName
|
threading.currentThread().name = origThreadName
|
||||||
|
|
||||||
|
didSearch = True
|
||||||
|
|
||||||
if len(searchResults):
|
if len(searchResults):
|
||||||
# make a list of all the results for this provider
|
# make a list of all the results for this provider
|
||||||
for curEp in searchResults:
|
for curEp in searchResults:
|
||||||
|
@ -668,8 +673,8 @@ def searchProviders(show, season, episodes, manualSearch=False):
|
||||||
if wantedEpCount == len(episodes):
|
if wantedEpCount == len(episodes):
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
if not didSearch:
|
||||||
logger.log(u"No NZB/Torrent providers found or enabled in the sickrage config. Please check your settings.",
|
logger.log(u"No NZB/Torrent providers found or enabled in the sickrage config for backlog searches. Please check your settings.",
|
||||||
logger.ERROR)
|
logger.ERROR)
|
||||||
|
|
||||||
return finalResults
|
return finalResults
|
||||||
|
|
Loading…
Reference in a new issue