Commit ddeaf996 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Fix results from cache not honoring ignored/required words

parent dc9bad3a
......@@ -316,7 +316,9 @@ class TVCache():
cl = []
myDB = self._getDB()
if type(episode) != list:
if not episode:
sqlResults = myDB.select("SELECT * FROM [" + self.providerID + "]")
elif type(episode) != list:
sqlResults = myDB.select(
"SELECT * FROM [" + self.providerID + "] WHERE indexerid = ? AND season = ? AND episodes LIKE ?",
[episode.show.indexerid, episode.season, "%|" + str(episode.episode) + "|%"])
......@@ -332,6 +334,10 @@ class TVCache():
# for each cache entry
for curResult in sqlResults:
# ignored/required words, and non-tv junk
if not show_name_helpers.filterBadReleases(curResult["name"]):
continue
# get the show object, or if it's not one of our shows then ignore it
showObj = helpers.findCertainShow(sickbeard.showList, int(curResult["indexerid"]))
if not showObj:
......@@ -346,9 +352,11 @@ class TVCache():
curSeason = int(curResult["season"])
if curSeason == -1:
continue
curEp = curResult["episodes"].split("|")[1]
if not curEp:
continue
curEp = int(curEp)
curQuality = int(curResult["quality"])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment