Commit 15c6a478 authored by echel0n's avatar echel0n
Browse files

Fixed issues with downloading subtitles

Fix KeyError for black and white lists
Fixed NoneType error for indexer api
parent 0f68f72c
# Changelog
- * b0c0edf - 2018-05-18: Converted log error to warning for Discord client Refactored SabNZBd client code
- * 8178288 - 2018-05-18: Fixed issues with downloading subtitles Fix KeyError for black and white lists Fixed NoneType error for indexer api
- * 0f68f72 - 2018-05-18: Converted log error to warning for Discord client Refactored SabNZBd client code
- * a3c7441 - 2018-05-18: Misc small fixes
- * 5f5592c - 2018-05-18: Misc typo corrections Converted errors to warnings for email notifications
- * 1630902 - 2018-05-17: Release v9.3.22
......
......@@ -98,10 +98,12 @@ class BlackAndWhiteList(object):
:return: keywords in list
"""
groups = [x['keyword']for x in sickrage.app.main_db.get_many(table, self.show_id)]
try:
groups = [x['keyword'] for x in sickrage.app.main_db.get_many(table, self.show_id)]
except KeyError:
groups = []
sickrage.app.log.debug(
'BWL: ' + str(self.show_id) + ' loaded keywords from ' + table + ': ' + str(groups))
sickrage.app.log.debug('BWL: ' + str(self.show_id) + ' loaded keywords from ' + table + ': ' + str(groups))
return groups
......
......@@ -300,8 +300,9 @@ class NameParser(object):
season_number = int(epObj["airedseason"])
episode_numbers = [int(epObj["airedepisodenumber"])]
except indexer_episodenotfound:
sickrage.app.log.warning(
"Unable to find episode with date " + bestResult.air_date + " for show " + bestResult.show.name + ", skipping")
sickrage.app.log.warning("Unable to find episode with date {air_date} for show {show_name}, "
"skipping".format(air_date=bestResult.air_date,
show_name=bestResult.show.name))
episode_numbers = []
except indexer_error as e:
sickrage.app.log.warning(
......
......@@ -563,7 +563,7 @@ class QueueItemUpdate(ShowQueueItem):
"Unable to contact " + IndexerApi(self.show.indexer).name + ", aborting: {}".format(e))
return
except indexer_attributenotfound as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Data retrieved from " + IndexerApi(self.show.indexer).name + " was incomplete, aborting: {}".format(e))
return
......
......@@ -138,7 +138,7 @@ class Show(dict):
return dict.__getitem__(self.data, key)
# Data wasn't found, raise appropriate error
if isinstance(key, int) or key.isdigit():
if key and (isinstance(key, int) or key.isdigit()):
# Season number x was not found
raise tvdb_seasonnotfound("Could not find season {}".format(repr(key)))
else:
......@@ -210,7 +210,7 @@ class Season(dict):
# Non-numeric request is for season-data
return dict.__getitem__(self.data, key)
if isinstance(key, int) or key.isdigit():
if key and (isinstance(key, int) or key.isdigit()):
raise tvdb_episodenotfound("Could not find episode {}".format(repr(key)))
else:
raise tvdb_attributenotfound("Cannot find attribute {}".format(repr(key)))
......
......@@ -90,6 +90,8 @@ def getEnabledServiceList():
def download_subtitles(episode):
existing_subtitles = episode.subtitles
if not isinstance(existing_subtitles, list):
existing_subtitles = []
# First of all, check if we need subtitles
languages = get_needed_languages(existing_subtitles)
......
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