From c68497bba011d28d8e88cec10f51648f98d2aded Mon Sep 17 00:00:00 2001 From: Chris Rudmin Date: Wed, 4 Dec 2024 23:46:02 -0500 Subject: [PATCH 1/2] Add Missing timeout _timeout is expected on PlexClient --- plexapi/sonos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plexapi/sonos.py b/plexapi/sonos.py index 14f83d31d..2b26d0d84 100644 --- a/plexapi/sonos.py +++ b/plexapi/sonos.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import requests -from plexapi import CONFIG, X_PLEX_IDENTIFIER +from plexapi import CONFIG, X_PLEX_IDENTIFIER, TIMEOUT from plexapi.client import PlexClient from plexapi.exceptions import BadRequest from plexapi.playqueue import PlayQueue @@ -66,6 +66,7 @@ def __init__(self, account, data): self._last_call = 0 self._proxyThroughServer = False self._showSecrets = CONFIG.get("log.show_secrets", "").lower() == "true" + self._timeout = TIMEOUT def playMedia(self, media, offset=0, **params): From 08c8496bfc8f4ee6058ed7041b8e7dea7aba1730 Mon Sep 17 00:00:00 2001 From: Chris Rudmin Date: Thu, 5 Dec 2024 00:09:20 -0500 Subject: [PATCH 2/2] Update sonos.py Add keyword arguments --- plexapi/sonos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexapi/sonos.py b/plexapi/sonos.py index 2b26d0d84..8f1295f44 100644 --- a/plexapi/sonos.py +++ b/plexapi/sonos.py @@ -46,7 +46,7 @@ class PlexSonosClient(PlexClient): _session (obj): Requests session object used to access this client. """ - def __init__(self, account, data): + def __init__(self, account, data, timeout=None): self._data = data self.deviceClass = data.attrib.get("deviceClass") self.machineIdentifier = data.attrib.get("machineIdentifier") @@ -66,7 +66,7 @@ def __init__(self, account, data): self._last_call = 0 self._proxyThroughServer = False self._showSecrets = CONFIG.get("log.show_secrets", "").lower() == "true" - self._timeout = TIMEOUT + self._timeout = timeout or TIMEOUT def playMedia(self, media, offset=0, **params):