diff --git a/music_assistant/server/providers/plex/__init__.py b/music_assistant/server/providers/plex/__init__.py index 22cbca627..25c685f19 100644 --- a/music_assistant/server/providers/plex/__init__.py +++ b/music_assistant/server/providers/plex/__init__.py @@ -155,7 +155,7 @@ async def get_config_entries( server_http_port = values.get(CONF_LOCAL_SERVER_PORT) server_http_ssl = values.get(CONF_LOCAL_SERVER_SSL) server_http_verify_cert = values.get(CONF_LOCAL_SERVER_VERIFY_CERT) - if not (libraries := await get_libraries(mass, token, server_http_ssl, server_http_ip, + if not (libraries := await get_libraries(mass, token, server_http_ssl, server_http_ip, server_http_port, server_http_verify_cert)): msg = "Unable to retrieve Servers and/or Music Libraries" raise LoginFailed(msg) @@ -236,9 +236,9 @@ async def handle_async_init(self) -> None: def connect() -> PlexServer: try: session = requests.Session() - session.verify = (self.config.get_value(CONF_LOCAL_SERVER_VERIFY_CERT) + session.verify = (self.config.get_value(CONF_LOCAL_SERVER_VERIFY_CERT) if self.config.get_value(CONF_LOCAL_SERVER_SSL) else False) - local_server_protocol = ("https" if self.config.get_value(CONF_LOCAL_SERVER_SSL) + local_server_protocol = ("https" if self.config.get_value(CONF_LOCAL_SERVER_SSL) else "http") plex_server = PlexServer( f"{local_server_protocol}://{self.config.get_value(CONF_LOCAL_SERVER_IP)}:{self.config.get_value(CONF_LOCAL_SERVER_PORT)}", diff --git a/music_assistant/server/providers/plex/helpers.py b/music_assistant/server/providers/plex/helpers.py index 1bc118785..3d39dd630 100644 --- a/music_assistant/server/providers/plex/helpers.py +++ b/music_assistant/server/providers/plex/helpers.py @@ -16,7 +16,7 @@ async def get_libraries( - mass: MusicAssistant, auth_token: str, local_server_ssl: bool, local_server_ip: str, + mass: MusicAssistant, auth_token: str, local_server_ssl: bool, local_server_ip: str, local_server_port: str, local_server_verify_cert: bool ) -> list[str]: """ @@ -33,7 +33,7 @@ def _get_libraries(): session.verify = local_server_verify_cert local_server_protocol = "https" if local_server_ssl else "http" plex_server: PlexServer = PlexServer( - f"{local_server_protocol}://{local_server_ip}:{local_server_port}", auth_token, + f"{local_server_protocol}://{local_server_ip}:{local_server_port}", auth_token, session=session ) for media_section in plex_server.library.sections():