From 102ee808f68585cd877e200e4a2be5575a3c2db2 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 22 Nov 2021 15:47:26 -0500 Subject: [PATCH] add_existing fix --- modules/builder.py | 3 +++ modules/config.py | 1 + modules/library.py | 1 + modules/plex.py | 11 +++++++++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/builder.py b/modules/builder.py index 7a347f1e..302747e9 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -609,6 +609,9 @@ class CollectionBuilder: self.sonarr_details["add"] = False self.sonarr_details["add_existing"] = False + if self.radarr_details["add_existing"] or self.sonarr_details["add_existing"]: + self.item_details["add_existing"] = True + if self.collectionless: self.details["collection_mode"] = "hide" self.sync = True diff --git a/modules/config.py b/modules/config.py index 04bb6375..dbb45a67 100644 --- a/modules/config.py +++ b/modules/config.py @@ -495,6 +495,7 @@ class Config: self.errors.append(e) util.print_stacktrace() util.print_multiline(e, error=True) + logger.info("") logger.info(f"{display_name} Library Connection Failed") continue diff --git a/modules/library.py b/modules/library.py index 0d1cceb9..9e063323 100644 --- a/modules/library.py +++ b/modules/library.py @@ -102,6 +102,7 @@ class Library(ABC): logger.info(f"Using Asset Directory: {ad}") if output: + logger.info("") logger.info(output) def upload_images(self, item, poster=None, background=None, overlay=None): diff --git a/modules/plex.py b/modules/plex.py index 0fbc69bd..b067bd1a 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -230,6 +230,7 @@ class Plex(Library): self.url = params["plex"]["url"] self.token = params["plex"]["token"] self.timeout = params["plex"]["timeout"] + logger.info("") try: self.PlexServer = PlexServer(baseurl=self.url, token=self.token, session=self.config.session, timeout=self.timeout) except Unauthorized: @@ -239,9 +240,15 @@ class Plex(Library): except (requests.exceptions.ConnectionError, ParseError): util.print_stacktrace() raise Failed("Plex Error: Plex url is invalid") - self.Plex = next((s for s in self.PlexServer.library.sections() if s.title == params["name"]), None) + self.Plex = None + library_names = [] + for s in self.PlexServer.library.sections(): + library_names.append(s.title) + if s.title == params["name"]: + self.Plex = s + break if not self.Plex: - raise Failed(f"Plex Error: Plex Library {params['name']} not found") + raise Failed(f"Plex Error: Plex Library {params['name']} not found. Options: {library_names}") if self.Plex.type in ["movie", "show"]: self.type = self.Plex.type.capitalize() else: