diff --git a/VERSION b/VERSION index 8a056d1a..fd79857c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.20.0-develop45 +1.20.0-develop46 diff --git a/modules/config.py b/modules/config.py index 43098364..7fb74d15 100644 --- a/modules/config.py +++ b/modules/config.py @@ -169,6 +169,7 @@ class ConfigFile: self.overlays_only = attrs["overlays_only"] if "overlays_only" in attrs else False self.env_plex_url = attrs["plex_url"] if "plex_url" in attrs else "" self.env_plex_token = attrs["plex_token"] if "plex_token" in attrs else "" + self.tpdb_timer = None current_time = datetime.now() with open(self.config_path, encoding="utf-8") as fp: diff --git a/modules/plex.py b/modules/plex.py index 69a22072..343b6d59 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -1,4 +1,4 @@ -import os, plexapi, re, requests +import os, plexapi, re, requests, time from datetime import datetime, timedelta from modules import builder, util from modules.library import Library @@ -791,6 +791,13 @@ class Plex(Library): @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) def _upload_image(self, item, image): try: + if image.is_url and "theposterdb.com" in image.location: + now = datetime.now() + if self.config.tpdb_timer is not None: + while self.config.tpdb_timer + timedelta(seconds=6) > now: + time.sleep(1) + now = datetime.now() + self.config.tpdb_timer = now if image.is_poster and image.is_url: item.uploadPoster(url=image.location) elif image.is_poster: