mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
fixed import #102
This commit is contained in:
parent
eafd51e5f2
commit
a919a1bb59
2 changed files with 7 additions and 7 deletions
|
@ -229,7 +229,7 @@ class Config:
|
||||||
self.IMDb = IMDbAPI(self)
|
self.IMDb = IMDbAPI(self)
|
||||||
self.AniDB = AniDBAPI(self)
|
self.AniDB = AniDBAPI(self)
|
||||||
self.AniList = AniListAPI(self)
|
self.AniList = AniListAPI(self)
|
||||||
self.Letterboxd = LetterboxdAPI()
|
self.Letterboxd = LetterboxdAPI(self)
|
||||||
|
|
||||||
util.separator()
|
util.separator()
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ from retrying import retry
|
||||||
logger = logging.getLogger("Plex Meta Manager")
|
logger = logging.getLogger("Plex Meta Manager")
|
||||||
|
|
||||||
class LetterboxdAPI:
|
class LetterboxdAPI:
|
||||||
def __init__(self, Cache=None):
|
def __init__(self, config):
|
||||||
|
self.config = config
|
||||||
self.url = "https://letterboxd.com"
|
self.url = "https://letterboxd.com"
|
||||||
self.Cache = Cache
|
|
||||||
|
|
||||||
@retry(stop_max_attempt_number=6, wait_fixed=10000)
|
@retry(stop_max_attempt_number=6, wait_fixed=10000)
|
||||||
def send_request(self, url, language):
|
def send_request(self, url, language):
|
||||||
|
@ -57,16 +57,16 @@ class LetterboxdAPI:
|
||||||
length = util.print_return(length, f"Finding TMDb ID {i}/{total_items}")
|
length = util.print_return(length, f"Finding TMDb ID {i}/{total_items}")
|
||||||
tmdb_id = None
|
tmdb_id = None
|
||||||
expired = None
|
expired = None
|
||||||
if self.Cache:
|
if self.config.Cache:
|
||||||
tmdb_id, expired = self.Cache.query_letterboxd_map(item[0])
|
tmdb_id, expired = self.config.Cache.query_letterboxd_map(item[0])
|
||||||
if not tmdb_id or expired is not False:
|
if not tmdb_id or expired is not False:
|
||||||
try:
|
try:
|
||||||
tmdb_id = self.get_tmdb_from_slug(item[1], language)
|
tmdb_id = self.get_tmdb_from_slug(item[1], language)
|
||||||
except Failed as e:
|
except Failed as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
continue
|
continue
|
||||||
if self.Cache:
|
if self.config.ache:
|
||||||
self.Cache.update_letterboxd(expired, item[0], tmdb_id)
|
self.config.Cache.update_letterboxd(expired, item[0], tmdb_id)
|
||||||
movie_ids.append(tmdb_id)
|
movie_ids.append(tmdb_id)
|
||||||
util.print_end(length, f"Processed {total_items} TMDb IDs")
|
util.print_end(length, f"Processed {total_items} TMDb IDs")
|
||||||
if status_message:
|
if status_message:
|
||||||
|
|
Loading…
Reference in a new issue