From 73d1ae56a983b75aecd590a7905071f0dc3352c2 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Mon, 16 Oct 2023 06:00:27 +0200 Subject: [PATCH 1/2] Change improve Emby status check. By preventing exceptions from wrong type comparison in a fetched response --- sickgear/notifiers/emby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sickgear/notifiers/emby.py b/sickgear/notifiers/emby.py index 196f23b4..a95cf115 100644 --- a/sickgear/notifiers/emby.py +++ b/sickgear/notifiers/emby.py @@ -127,15 +127,15 @@ class EmbyNotifier(Notifier): response = self._request(f'Library/{endpoint}/Updated', cur_host, keys[i], **args) # Emby will initiate a LibraryMonitor path refresh one minute after this success - if 200 <= self.response.get('status_code') < 300 and self.response.get('ok'): + if 200 <= (self.response.get('status_code') or 0) < 300 and self.response.get('ok'): self._log(f'Success: update {mode_to_log} sent to host {cur_host} in a library updated call') continue - elif 401 == self.response.get('status_code'): + elif 401 == self.response.get('status_code', 0): self._log_warning(f'Failed to authenticate with {cur_host}') - elif 404 == self.response.get('status_code'): + elif 404 == self.response.get('status_code', 0): args = dict(post_json={'Updates': [{'Path': '', 'UpdateType': ''}]}) self._request(f'Library/Media/Updated', cur_host, keys[i], **args) - if 200 <= self.response.get('status_code') < 300 and self.response.get('ok'): + if 200 <= (self.response.get('status_code') or 0) < 300 and self.response.get('ok'): self._log(f'Success: fallback to sending Library/Media/Updated call' f' to scan all shows at host {cur_host}') continue From 4cebf12fbd3b3774428caa19f420481b50173a42 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sun, 10 Dec 2023 00:24:32 +0100 Subject: [PATCH 2/2] Change allow Python 3.12.1 --- CHANGES.md | 8 +++++++- sickgear.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 825c0c65..991e3f35 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,10 @@ -### 3.30.4 (2023-10-12 11:50:00 UTC) +### 3.30.5 (2023-12-10 05:00:00 UTC) + +* Change allow Python 3.12.1 +* Change improve Emby status check + + +### 3.30.4 (2023-10-12 11:50:00 UTC) * Add metadata source attribution in footer diff --git a/sickgear.py b/sickgear.py index 8dc0f466..104154f1 100755 --- a/sickgear.py +++ b/sickgear.py @@ -38,7 +38,7 @@ warnings.filterwarnings('ignore', message='.*deprecated in cryptography.*') versions = [((3, 8, 2), (3, 8, 18)), ((3, 9, 0), (3, 9, 2)), ((3, 9, 4), (3, 9, 18)), - ((3, 10, 0), (3, 12, 0))] # inclusive version ranges + ((3, 10, 0), (3, 12, 1))] # inclusive version ranges if not any(list(map(lambda v: v[0] <= sys.version_info[:3] <= v[1], versions))) and not int(os.environ.get('PYT', 0)): major, minor, micro = sys.version_info[:3] print('Python %s.%s.%s detected.' % (major, minor, micro))