Commit f4b1e65d authored by echel0n's avatar echel0n

Fixed issue with scene exceptions not being retrieved.

Fixed issues with AniDB and Anime shows.
Builds name cache and retrieves exceptions on startup as a background task.
parent 9b5dd594
# Changelog
- * 6b8c9b2 - 2019-02-24: Release v9.4.74
- * 9394538 - 2019-02-24: Fixed issue with scene exceptions not being retrieved. Fixed issues with AniDB and Anime shows. Builds name cache and retrieves exceptions on startup as a background task.
- * 78d6b6e - 2019-02-24: Release v9.4.74
- * b690738 - 2019-02-24: Fixed issue with default add show options and add show year feature.
- * 90fa33d - 2019-02-24: Pre-Release v9.4.74.dev2
- * b2896ad - 2019-02-24: Updated AniDB code for post-processor. Added get episode function to AniDB helper.
......
......@@ -464,6 +464,16 @@ class Core(object):
id=self.upnp_client.name
)
# add namecache update job
self.scheduler.add_job(
self.name_cache.build_all,
IntervalTrigger(
days=1,
),
name=self.name_cache.name,
id=self.name_cache.name
)
# start scheduler service
self.scheduler.start()
......@@ -474,6 +484,7 @@ class Core(object):
self.event_queue.start()
# fire off startup events
self.event_queue.fire_event(self.name_cache.build_all)
self.event_queue.fire_event(self.version_updater.run)
self.event_queue.fire_event(self.tz_updater.run)
......
......@@ -30,6 +30,7 @@ from sickrage.core.scene_exceptions import retrieve_exceptions, get_scene_season
class NameCache(object):
def __init__(self, *args, **kwargs):
self.name = "NAMECACHE"
self.min_time = 10
self.last_update = {}
self.cache = {}
......@@ -129,4 +130,4 @@ class NameCache(object):
def build_all(self):
for show in sickrage.app.showlist:
self.build(show)
\ No newline at end of file
self.build(show)
......@@ -97,18 +97,18 @@ def get_anime_episode(file_path):
ep = None
if set_up_anidb_connection():
ep = adba.aniDBAbstracter.Episode(sickrage.app.adba_connection, filePath=file_path,
paramsF=[
"quality",
"anidb_file_name",
"crc32"
],
paramsA=[
"epno",
"english_name",
"short_name_list",
"other_name",
"synonym_list"
])
ep = adba.Episode(sickrage.app.adba_connection, filePath=file_path,
paramsF=[
"quality",
"anidb_file_name",
"crc32"
],
paramsA=[
"epno",
"english_name",
"short_name_list",
"other_name",
"synonym_list"
])
return ep
......@@ -330,11 +330,11 @@ class NameParser(object):
new_season_numbers.append(s)
elif bestResult.show.is_anime and bestResult.ab_episode_numbers:
scene_season = get_scene_exception_by_name(bestResult.series_name)[1]
for epAbsNo in bestResult.ab_episode_numbers:
a = epAbsNo
if bestResult.show.is_scene:
scene_season = get_scene_exception_by_name(bestResult.series_name)[1]
a = get_indexer_absolute_numbering(bestResult.show.indexerid,
bestResult.show.indexer, epAbsNo,
True, scene_season)
......
......@@ -632,13 +632,13 @@ class PostProcessor(object):
if not self.anidbEpisode: # seems like we could parse the name before, now lets build the anidb object
self.anidbEpisode = get_anime_episode(filePath)
if self.anidbEpisode:
self._log("Adding the file to the anidb mylist", sickrage.app.log.DEBUG)
self._log("Adding the file to the AniDB MyList", sickrage.app.log.DEBUG)
try:
# status of 1 sets the status of the file to "internal HDD"
self.anidbEpisode.add_to_mylist(status=1)
# state of 1 sets the state of the file to "internal HDD"
self.anidbEpisode.add_to_mylist(state=1)
except Exception as e:
self._log("exception msg: " + str(e))
self.log('Exception message: {0!r}'.format(e))
def _find_info(self):
"""
......
......@@ -126,9 +126,6 @@ def retrieve_exceptions(get_xem=True, get_anidb=True):
existing_exceptions = [x["show_name"] for x in
sickrage.app.cache_db.get_many('scene_exceptions', cur_indexer_id)]
if not len(existing_exceptions):
continue
for cur_exception, curSeason in dict([(key, d[key]) for d in cur_exception_dict for key in d]).items():
if cur_exception not in existing_exceptions:
updated_exceptions = True
......
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