Commit 3e50472a authored by echel0n's avatar echel0n
Browse files

Added code to build show name cache on startup of app.

Fixed issue with show lookup during name parsing.
parent f00e4ace
# Changelog # Changelog
- * ea173ba - 2018-10-28: Release v9.4.4 - * ceb1967 - 2018-11-03: Added code to build show name cache on startup of app. Fixed issue with show lookup during name parsing.
- * f91c70b - 2018-10-28: Release v9.4.4
- * bb87bb2 - 2018-10-28: Added code to get default download location from Synology Download Station - * bb87bb2 - 2018-10-28: Added code to get default download location from Synology Download Station
- * d32be97 - 2018-10-28: Release v9.4.3 - * d32be97 - 2018-10-28: Release v9.4.3
- * f7c0464 - 2018-10-28: Fixed issue with unrar unpack directory setting - * f7c0464 - 2018-10-28: Fixed issue with unrar unpack directory setting
......
...@@ -345,7 +345,7 @@ class Core(object): ...@@ -345,7 +345,7 @@ class Core(object):
IntervalTrigger( IntervalTrigger(
hours=self.config.version_updater_freq hours=self.config.version_updater_freq
), ),
next_run_time=datetime.datetime.now(), next_run_time=datetime.datetime.now() + datetime.timedelta(minutes=1),
name=self.version_updater.name, name=self.version_updater.name,
id=self.version_updater.name id=self.version_updater.name
) )
...@@ -356,7 +356,7 @@ class Core(object): ...@@ -356,7 +356,7 @@ class Core(object):
IntervalTrigger( IntervalTrigger(
days=1 days=1
), ),
next_run_time=datetime.datetime.now(), next_run_time=datetime.datetime.now() + datetime.timedelta(minutes=1),
name=self.tz_updater.name, name=self.tz_updater.name,
id=self.tz_updater.name id=self.tz_updater.name
) )
...@@ -544,9 +544,12 @@ class Core(object): ...@@ -544,9 +544,12 @@ class Core(object):
self.quicksearch_cache.load() self.quicksearch_cache.load()
for dbData in self.main_db.all('tv_shows'): for dbData in self.main_db.all('tv_shows'):
show = TVShow(int(dbData['indexer']), int(dbData['indexer_id']))
try: try:
self.log.debug("Loading data for show: [{}]".format(dbData['show_name'])) self.log.debug("Loading data for show: [{}]".format(show.name))
self.showlist.append(TVShow(int(dbData['indexer']), int(dbData['indexer_id']))) self.showlist.append(show)
self.quicksearch_cache.add_show(dbData['indexer_id']) self.name_cache.build(show)
self.quicksearch_cache.add_show(show.indexerid)
except Exception as e: except Exception as e:
self.log.debug("Show error in [%s]: %s" % (dbData['location'], str(e))) self.log.debug("Show error in [%s]: %s" % (show.location, str(e)))
\ No newline at end of file
...@@ -88,20 +88,18 @@ class NameParser(object): ...@@ -88,20 +88,18 @@ class NameParser(object):
# lookup show id # lookup show id
for lookup in lookup_list: for lookup in lookup_list:
if show or show_id is not None:
continue
try: try:
show_id = int(lookup()) show_id = int(lookup())
if show_id == 0: if show_id == 0:
continue continue
sickrage.app.name_cache.put(show_name, show_id) if not show:
if self.validate_show: sickrage.app.name_cache.put(show_name, show_id)
show = findCertainShow(show_id) if self.validate_show:
else: show = findCertainShow(show_id)
from sickrage.core.tv.show import TVShow else:
show = TVShow(1, show_id) from sickrage.core.tv.show import TVShow
show = TVShow(1, show_id)
except Exception: except Exception:
pass pass
...@@ -519,7 +517,8 @@ class NameParser(object): ...@@ -519,7 +517,8 @@ class NameParser(object):
# if there's no useful info in it then raise an exception # if there's no useful info in it then raise an exception
if final_result.season_number is None and not final_result.episode_numbers and final_result.air_date is None and not final_result.ab_episode_numbers and not final_result.series_name: if final_result.season_number is None and not final_result.episode_numbers and final_result.air_date is None and not final_result.ab_episode_numbers and not final_result.series_name:
raise InvalidNameException("Unable to parse {} to a valid episode. Parser result: {}".format(name, final_result)) raise InvalidNameException(
"Unable to parse {} to a valid episode. Parser result: {}".format(name, final_result))
if cache_result and final_result.show: if cache_result and final_result.show:
name_parser_cache.add(name, final_result) name_parser_cache.add(name, final_result)
......
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