Commit 9004608b authored by echel0n's avatar echel0n

Resolved incorrect handling of indexer error for `_show_data` metadata class method.

Commented out remove_duplicates_from_scene_name_table cache database cleanup function.
Added custom error message when indexer TheTVDB returns 504 HTTP error code.
parent 07148331
......@@ -62,7 +62,7 @@ class CacheDB(SRDatabase):
found.append((x.indexer_id, x.name))
remove_duplicates_from_last_search_table()
remove_duplicates_from_scene_name_table()
# remove_duplicates_from_scene_name_table()
class LastUpdate(CacheDBBase):
__tablename__ = 'last_update'
......
......@@ -458,6 +458,8 @@ class Tvdb:
if status_code == 401:
raise tvdb_unauthorized(error_message)
elif status_code == 504:
error_message = "Unable to connect to TheTVDB"
except Exception as e:
error_message = "{!r}".format(e)
......
......@@ -340,7 +340,6 @@ class GenericMetadata(object):
"""
data = self._show_data(show_obj)
if not data:
return False
......
......@@ -115,19 +115,15 @@ class KODI_12PlusMetadata(GenericMetadata):
try:
myShow = t[int(show_ID)]
except indexer_shownotfound:
sickrage.app.log.error("Unable to find show with id " + str(show_ID) + " on " + IndexerApi(
show_obj.indexer).name + ", skipping it")
raise
sickrage.app.log.error("Unable to find show with id " + str(show_ID) + " on " + IndexerApi(show_obj.indexer).name + ", skipping it")
return
except indexer_error:
sickrage.app.log.error(
"" + IndexerApi(show_obj.indexer).name + " is down, can't use its data to add this show")
raise
sickrage.app.log.error("" + IndexerApi(show_obj.indexer).name + " is down, can't use its data to add this show")
return
# check for title and id
if not (getattr(myShow, 'seriesname', None) and getattr(myShow, 'id', None)):
sickrage.app.log.info("Incomplete info for show with id " + str(show_ID) + " on " + IndexerApi(
show_obj.indexer).name + ", skipping it")
sickrage.app.log.info("Incomplete info for show with id " + str(show_ID) + " on " + IndexerApi(show_obj.indexer).name + ", skipping it")
return False
title = SubElement(tv_node, "title")
......@@ -143,7 +139,7 @@ class KODI_12PlusMetadata(GenericMetadata):
if year_text:
year = SubElement(tv_node, "year")
year.text = year_text
except:
except Exception:
pass
if getattr(myShow, 'overview', None):
......
......@@ -118,13 +118,11 @@ class Mede8erMetadata(MediaBrowserMetadata):
try:
myShow = t[int(show_obj.indexer_id)]
except indexer_shownotfound:
sickrage.app.log.error(
"Unable to find show with id " + str(show_obj.indexer_id) + " on tvdb, skipping it")
raise
sickrage.app.log.error("Unable to find show with id " + str(show_obj.indexer_id) + " on " + IndexerApi(show_obj.indexer).name + ", skipping it")
return
except indexer_error:
sickrage.app.log.error("TVDB is down, can't use its data to make the NFO")
raise
sickrage.app.log.error("" + IndexerApi(show_obj.indexer).name + " is down, can't use its data to add this show")
return
# check for title and id
if not (getattr(myShow, 'seriesname', None) and getattr(myShow, 'id', None)):
......@@ -359,7 +357,6 @@ class Mede8erMetadata(MediaBrowserMetadata):
"""
data = self._show_data(show_obj)
if not data:
return False
......
......@@ -251,15 +251,11 @@ class MediaBrowserMetadata(GenericMetadata):
try:
myShow = t[int(show_obj.indexer_id)]
except indexer_shownotfound:
sickrage.app.log.error(
"Unable to find show with id " + str(show_obj.indexer_id) + " on " + IndexerApi(
show_obj.indexer).name + ", skipping it")
raise
sickrage.app.log.error("Unable to find show with id " + str(show_obj.indexer_id) + " on " + IndexerApi(show_obj.indexer).name + ", skipping it")
return
except indexer_error:
sickrage.app.log.error(
"" + IndexerApi(show_obj.indexer).name + " is down, can't use its data to make the NFO")
raise
sickrage.app.log.error("" + IndexerApi(show_obj.indexer).name + " is down, can't use its data to add this show")
return
# check for title and id
if not (getattr(myShow, 'seriesname', None) and getattr(myShow, 'id', None)):
......
Markdown is supported
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