From a862d79fa247684d52827d785fc56f3fae60968a Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 14 Sep 2021 17:50:39 -0400 Subject: [PATCH] fix mal and anidb caches --- modules/convert.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/convert.py b/modules/convert.py index 489a2a71..8f817cf6 100644 --- a/modules/convert.py +++ b/modules/convert.py @@ -193,16 +193,20 @@ class Convert: tvdb_id = [] imdb_id = [] anidb_id = None + guid = requests.utils.urlparse(item.guid) + item_type = guid.scheme.split(".")[-1] + check_id = guid.netloc if self.config.Cache: cache_id, imdb_check, media_type, expired = self.config.Cache.query_guid_map(item.guid) if cache_id and not expired: media_id_type = "movie" if "movie" in media_type else "show" + if item_type == "hama" and check_id.startswith("anidb"): + anidb_id = int(re.search("-(.*)", check_id).group(1)) + library.anidb_map[anidb_id] = item.ratingKey + elif item_type == "myanimelist": + library.mal_map[int(check_id)] = item.ratingKey return media_id_type, cache_id, imdb_check try: - guid = requests.utils.urlparse(item.guid) - item_type = guid.scheme.split(".")[-1] - check_id = guid.netloc - if item_type == "plex": try: for guid_tag in library.get_guids(item):