From b415c3a830ab035229c44026967d814e6dd615d5 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sat, 20 Nov 2021 18:09:45 -0500 Subject: [PATCH] omdb apikey check fix --- modules/omdb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/omdb.py b/modules/omdb.py index fa388d96..e8d95a75 100644 --- a/modules/omdb.py +++ b/modules/omdb.py @@ -40,11 +40,11 @@ class OMDb: self.config = config self.apikey = params["apikey"] self.limit = False - self.get_omdb("tt0080684") + self.get_omdb("tt0080684", ignore_cache=True) - def get_omdb(self, imdb_id): + def get_omdb(self, imdb_id, ignore_cache=False): expired = None - if self.config.Cache: + if self.config.Cache and not ignore_cache: omdb_dict, expired = self.config.Cache.query_omdb(imdb_id) if omdb_dict and expired is False: return OMDbObj(imdb_id, omdb_dict) @@ -53,7 +53,7 @@ class OMDb: response = self.config.get(base_url, params={"i": imdb_id, "apikey": self.apikey}) if response.status_code < 400: omdb = OMDbObj(imdb_id, response.json()) - if self.config.Cache: + if self.config.Cache and not ignore_cache: self.config.Cache.update_omdb(expired, omdb) return omdb else: