From f5468fa619b0ae3b94c62a0087ca5513078d1767 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Mon, 5 Jul 2021 10:28:08 +0100 Subject: [PATCH] Change add Synology DSM 7 compatibility. Fix exception when removing a show. --- CHANGES.md | 8 +++++++- sickbeard/clients/download_station.py | 7 ++++--- sickbeard/webserve.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b784df4..138679f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,10 @@ -### 0.24.8 (2021-06-30 23:05:00 UTC) +### 0.24.9 (2021-07-05 10:25:00 UTC) + +* Change add Synology DSM 7 compatibility +* Fix exception when removing a show + + +### 0.24.8 (2021-06-30 23:05:00 UTC) * Fix nameparser unit tests diff --git a/sickbeard/clients/download_station.py b/sickbeard/clients/download_station.py index 0bdbc33..a668bc2 100644 --- a/sickbeard/clients/download_station.py +++ b/sickbeard/clients/download_station.py @@ -56,7 +56,7 @@ class DownloadStationAPI(GenericClient): 102: 'The requested API does not exist', 103: 'The requested method does not exist', 104: 'The requested version does not support the functionality', 105: 'The logged in session does not have permission', 106: 'Session timeout', - 107: 'Session interrupted by duplicate login', + 107: 'Session interrupted by duplicate login', 119: 'SID not found', 120: 'Wrong parameter', } def _error(self, msg): @@ -107,7 +107,7 @@ class DownloadStationAPI(GenericClient): return result def _tinf(self, ids=None, err=False): - # type: (Optional[list], bool) -> list + # type: (Optional[AnyStr, list], bool) -> list """ Fetch client task information :param ids: Optional id(s) to get task info for. None to get all task info @@ -385,7 +385,8 @@ class DownloadStationAPI(GenericClient): response = {} try: - params = dict(method='login', api='SYNO.API.Auth', version=(1, 2)[1 < self._auth_version], + params = dict(method='login', api='SYNO.API.Auth', + version=(1, (2, self._auth_version)[7 <= self._auth_version])[1 < self._auth_version], account=self.username, passwd=self.password, session='DownloadStation') params.update(({}, dict(format='sid'))[1 < self._auth_version]) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index dfba649..609375b 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -2310,7 +2310,7 @@ class Home(MainHandler): response = {} for cur_show_obj in shows: - if cur_show_obj.path: + if cur_show_obj and cur_show_obj.path: loc_size = helpers.get_size(cur_show_obj.path) num_files, smallest, largest, average_size = get_media_stats(cur_show_obj.path) response[cur_show_obj.tvid_prodid] = {'message': 'No media files'} if not num_files else \