mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 06:45:05 -05:00
Fixes issues found in cache and with season pack searches
This commit is contained in:
parent
dd9a7f657e
commit
5252cbb72c
@ -270,7 +270,7 @@ class GenericProvider:
|
||||
|
||||
# get our season pack search results
|
||||
if seasonSearch:
|
||||
for curString in self._get_episode_search_strings(epObj):
|
||||
for curString in self._get_season_search_strings(epObj):
|
||||
itemList += self._doSearch(curString)
|
||||
|
||||
# get our season/episode search results
|
||||
|
@ -138,7 +138,7 @@ class TVCache():
|
||||
title = self._translateTitle(title)
|
||||
url = self._translateLinkURL(url)
|
||||
|
||||
logger.log(u"Adding item from RSS to cache: " + title, logger.DEBUG)
|
||||
logger.log(u"Checking if item from RSS feed is in the cache: " + title, logger.DEBUG)
|
||||
return self._addCacheEntry(title, url)
|
||||
|
||||
else:
|
||||
@ -256,25 +256,20 @@ class TVCache():
|
||||
#return filter(lambda x: x['indexerid'] != 0, myDB.select(sql))
|
||||
return myDB.select(sql)
|
||||
|
||||
def findNeededEpisodes(self, episode=None, manualSearch=False):
|
||||
def findNeededEpisodes(self, epObj=None, manualSearch=False):
|
||||
neededEps = {}
|
||||
|
||||
myDB = self._getDB()
|
||||
|
||||
if not episode:
|
||||
if not epObj:
|
||||
sqlResults = myDB.select("SELECT * FROM [" + self.providerID + "]")
|
||||
else:
|
||||
sqlResults = myDB.select(
|
||||
"SELECT * FROM [" + self.providerID + "] WHERE indexerid = ? AND season = ? AND episodes LIKE ?",
|
||||
[episode.show.indexerid, episode.scene_season, "%|" + str(episode.scene_episode) + "|%"])
|
||||
[epObj.show.indexerid, epObj.scene_season, "%|" + str(epObj.scene_episode) + "|%"])
|
||||
|
||||
# for each cache entry
|
||||
for curResult in sqlResults:
|
||||
# skip if we don't have a indexerid
|
||||
indexerid = int(curResult["indexerid"])
|
||||
if not indexerid:
|
||||
continue
|
||||
|
||||
# skip non-tv crap (but allow them for Newzbin cause we assume it's filtered well)
|
||||
if self.providerID != 'newzbin' and not show_name_helpers.filterBadReleases(curResult["name"]):
|
||||
continue
|
||||
@ -303,11 +298,10 @@ class TVCache():
|
||||
logger.log(u"Skipping " + curResult["name"] + " because we don't want an episode that's " +
|
||||
Quality.qualityStrings[curQuality], logger.DEBUG)
|
||||
else:
|
||||
epObj = None
|
||||
if episode:
|
||||
epObj = episode
|
||||
|
||||
if epObj:
|
||||
if not epObj:
|
||||
epObj = showObj.getEpisode(curSeason, curEp)
|
||||
|
||||
# build a result object
|
||||
title = curResult["name"]
|
||||
url = curResult["url"]
|
||||
|
Loading…
Reference in New Issue
Block a user