mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 06:45:05 -05:00
Fixed more unrequired search strings from being created and wasting our time doing duplicate searches
This commit is contained in:
parent
4576ade4ce
commit
e309aa2cbf
@ -232,7 +232,13 @@ class GenericProvider:
|
|||||||
searchItems = {}
|
searchItems = {}
|
||||||
itemList = []
|
itemList = []
|
||||||
|
|
||||||
|
searched_scene_season = None
|
||||||
for epObj in episodes:
|
for epObj in episodes:
|
||||||
|
scene_season = epObj.scene_season
|
||||||
|
if seasonSearch and searched_scene_season:
|
||||||
|
if scene_season == searched_scene_season:
|
||||||
|
continue
|
||||||
|
|
||||||
if not epObj.show.air_by_date:
|
if not epObj.show.air_by_date:
|
||||||
if epObj.scene_season == 0 or epObj.scene_episode == 0:
|
if epObj.scene_season == 0 or epObj.scene_episode == 0:
|
||||||
logger.log(
|
logger.log(
|
||||||
@ -257,18 +263,17 @@ class GenericProvider:
|
|||||||
|
|
||||||
# remove duplicate items
|
# remove duplicate items
|
||||||
itemList = [i for n, i in enumerate(itemList) if i not in itemList[n + 1:]]
|
itemList = [i for n, i in enumerate(itemList) if i not in itemList[n + 1:]]
|
||||||
|
|
||||||
if epObj.episode in searchItems:
|
|
||||||
searchItems[epObj] += itemList
|
|
||||||
else:
|
|
||||||
searchItems[epObj] = itemList
|
searchItems[epObj] = itemList
|
||||||
|
|
||||||
|
# mark season searched so we can skip anymore searches of this season if this is a season pack search
|
||||||
|
searched_scene_season = scene_season
|
||||||
|
|
||||||
# if we have cached results return them.
|
# if we have cached results return them.
|
||||||
if len(results):
|
if len(results):
|
||||||
return results
|
return results
|
||||||
|
|
||||||
for ep_obj, items in searchItems.items():
|
for ep_obj in searchItems:
|
||||||
for item in items:
|
for item in searchItems[ep_obj]:
|
||||||
|
|
||||||
(title, url) = self._get_title_and_url(item)
|
(title, url) = self._get_title_and_url(item)
|
||||||
|
|
||||||
|
@ -317,7 +317,10 @@ def filterSearchResults(show, results):
|
|||||||
|
|
||||||
|
|
||||||
def searchProviders(queueItem, show, season, episodes, seasonSearch=False, manualSearch=False):
|
def searchProviders(queueItem, show, season, episodes, seasonSearch=False, manualSearch=False):
|
||||||
logger.log(u"Searching for stuff we need from " + show.name + " season " + str(season))
|
if seasonSearch:
|
||||||
|
logger.log(u"Searching for " + show.name + " season " + str(season) + " pack")
|
||||||
|
else:
|
||||||
|
logger.log(u"Searching for episodes we need from " + show.name + " season " + str(season))
|
||||||
|
|
||||||
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive()]
|
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive()]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user