From a919a1bb5919973b7d15f641c57907ead98e6aec Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 12 Mar 2021 18:16:26 -0500 Subject: [PATCH] fixed import #102 --- modules/config.py | 2 +- modules/letterboxd.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/config.py b/modules/config.py index 757307b9..b78ff645 100644 --- a/modules/config.py +++ b/modules/config.py @@ -229,7 +229,7 @@ class Config: self.IMDb = IMDbAPI(self) self.AniDB = AniDBAPI(self) self.AniList = AniListAPI(self) - self.Letterboxd = LetterboxdAPI() + self.Letterboxd = LetterboxdAPI(self) util.separator() diff --git a/modules/letterboxd.py b/modules/letterboxd.py index 9a27f020..2a61551d 100644 --- a/modules/letterboxd.py +++ b/modules/letterboxd.py @@ -7,9 +7,9 @@ from retrying import retry logger = logging.getLogger("Plex Meta Manager") class LetterboxdAPI: - def __init__(self, Cache=None): + def __init__(self, config): + self.config = config self.url = "https://letterboxd.com" - self.Cache = Cache @retry(stop_max_attempt_number=6, wait_fixed=10000) def send_request(self, url, language): @@ -57,16 +57,16 @@ class LetterboxdAPI: length = util.print_return(length, f"Finding TMDb ID {i}/{total_items}") tmdb_id = None expired = None - if self.Cache: - tmdb_id, expired = self.Cache.query_letterboxd_map(item[0]) + if self.config.Cache: + tmdb_id, expired = self.config.Cache.query_letterboxd_map(item[0]) if not tmdb_id or expired is not False: try: tmdb_id = self.get_tmdb_from_slug(item[1], language) except Failed as e: logger.error(e) continue - if self.Cache: - self.Cache.update_letterboxd(expired, item[0], tmdb_id) + if self.config.ache: + self.config.Cache.update_letterboxd(expired, item[0], tmdb_id) movie_ids.append(tmdb_id) util.print_end(length, f"Processed {total_items} TMDb IDs") if status_message: