mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-08 12:28: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
|
# get our season pack search results
|
||||||
if seasonSearch:
|
if seasonSearch:
|
||||||
for curString in self._get_episode_search_strings(epObj):
|
for curString in self._get_season_search_strings(epObj):
|
||||||
itemList += self._doSearch(curString)
|
itemList += self._doSearch(curString)
|
||||||
|
|
||||||
# get our season/episode search results
|
# get our season/episode search results
|
||||||
|
@ -138,7 +138,7 @@ class TVCache():
|
|||||||
title = self._translateTitle(title)
|
title = self._translateTitle(title)
|
||||||
url = self._translateLinkURL(url)
|
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)
|
return self._addCacheEntry(title, url)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -256,25 +256,20 @@ class TVCache():
|
|||||||
#return filter(lambda x: x['indexerid'] != 0, myDB.select(sql))
|
#return filter(lambda x: x['indexerid'] != 0, myDB.select(sql))
|
||||||
return myDB.select(sql)
|
return myDB.select(sql)
|
||||||
|
|
||||||
def findNeededEpisodes(self, episode=None, manualSearch=False):
|
def findNeededEpisodes(self, epObj=None, manualSearch=False):
|
||||||
neededEps = {}
|
neededEps = {}
|
||||||
|
|
||||||
myDB = self._getDB()
|
myDB = self._getDB()
|
||||||
|
|
||||||
if not episode:
|
if not epObj:
|
||||||
sqlResults = myDB.select("SELECT * FROM [" + self.providerID + "]")
|
sqlResults = myDB.select("SELECT * FROM [" + self.providerID + "]")
|
||||||
else:
|
else:
|
||||||
sqlResults = myDB.select(
|
sqlResults = myDB.select(
|
||||||
"SELECT * FROM [" + self.providerID + "] WHERE indexerid = ? AND season = ? AND episodes LIKE ?",
|
"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 each cache entry
|
||||||
for curResult in sqlResults:
|
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)
|
# 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"]):
|
if self.providerID != 'newzbin' and not show_name_helpers.filterBadReleases(curResult["name"]):
|
||||||
continue
|
continue
|
||||||
@ -303,29 +298,28 @@ class TVCache():
|
|||||||
logger.log(u"Skipping " + curResult["name"] + " because we don't want an episode that's " +
|
logger.log(u"Skipping " + curResult["name"] + " because we don't want an episode that's " +
|
||||||
Quality.qualityStrings[curQuality], logger.DEBUG)
|
Quality.qualityStrings[curQuality], logger.DEBUG)
|
||||||
else:
|
else:
|
||||||
epObj = None
|
|
||||||
if episode:
|
|
||||||
epObj = episode
|
|
||||||
|
|
||||||
if epObj:
|
if not epObj:
|
||||||
# build a result object
|
epObj = showObj.getEpisode(curSeason, curEp)
|
||||||
title = curResult["name"]
|
|
||||||
url = curResult["url"]
|
|
||||||
|
|
||||||
logger.log(u"Found result " + title + " at " + url)
|
# build a result object
|
||||||
|
title = curResult["name"]
|
||||||
|
url = curResult["url"]
|
||||||
|
|
||||||
result = self.provider.getResult([epObj])
|
logger.log(u"Found result " + title + " at " + url)
|
||||||
result.url = url
|
|
||||||
result.name = title
|
|
||||||
result.quality = curQuality
|
|
||||||
result.content = self.provider.getURL(url) \
|
|
||||||
if self.provider.providerType == sickbeard.providers.generic.GenericProvider.TORRENT \
|
|
||||||
and not url.startswith('magnet') else None
|
|
||||||
|
|
||||||
# add it to the list
|
result = self.provider.getResult([epObj])
|
||||||
if epObj not in neededEps:
|
result.url = url
|
||||||
neededEps[epObj] = [result]
|
result.name = title
|
||||||
else:
|
result.quality = curQuality
|
||||||
neededEps[epObj].append(result)
|
result.content = self.provider.getURL(url) \
|
||||||
|
if self.provider.providerType == sickbeard.providers.generic.GenericProvider.TORRENT \
|
||||||
|
and not url.startswith('magnet') else None
|
||||||
|
|
||||||
|
# add it to the list
|
||||||
|
if epObj not in neededEps:
|
||||||
|
neededEps[epObj] = [result]
|
||||||
|
else:
|
||||||
|
neededEps[epObj].append(result)
|
||||||
|
|
||||||
return neededEps
|
return neededEps
|
||||||
|
Loading…
Reference in New Issue
Block a user