Fixes issues in tvcache

This commit is contained in:
echel0n 2014-05-03 03:36:57 -07:00
parent e789c065ee
commit 75c7fbf137
2 changed files with 6 additions and 3 deletions

View File

@ -973,7 +973,9 @@ def get_show_by_name(name):
if indexerid:
logger.log(u"Found Indexer ID:[" + repr(indexerid) + "], using that for [" + name + "}",logger.DEBUG)
if not showObj:
showObj = [x for x in sickbeard.showList if x.indexerid == indexerid][0]
showObjList = [x for x in sickbeard.showList if x.indexerid == indexerid]
if len(showObjList):
showObj = showObjList[0]
return showObj
def is_hidden_folder(folder):

View File

@ -203,7 +203,8 @@ class TVCache():
logger.log(u"No series name retrieved from " + name + ", unable to cache it", logger.DEBUG)
return None
if not helpers.get_show_by_name(parse_result.series_name):
showObj = helpers.get_show_by_name(parse_result.series_name)
if showObj:
logger.log(u"Could not find a show matching " + parse_result.series_name + " in the database, skipping ...", logger.DEBUG)
return None
@ -212,7 +213,7 @@ class TVCache():
airdate = parse_result.air_date.toordinal()
sql_results = myDB.select("SELECT season, episode FROM tv_episodes WHERE showid = ? AND indexer = ? AND airdate = ?",
[parse_result.show.indexerid, parse_result.show.indexer, airdate])
[showObj.indexerid, showObj.indexer, airdate])
if sql_results > 0:
season = int(sql_results[0]["season"])
episodes = [int(sql_results[0]["episode"])]