add_existing fix

pull/450/head
meisnate12 3 years ago
parent b415c3a830
commit 102ee808f6

@ -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

@ -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

@ -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):

@ -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:

Loading…
Cancel
Save