From 9640182515c2c832b19159c8ed450103bbffdfa4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 23 Nov 2026 17:35:54 +0800 Subject: [PATCH] fix(modules): parenthesize multi-exception clauses in plex and ugreen --- app/modules/plex/plex.py | 2 +- app/modules/ugreen/ugreen.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/modules/plex/plex.py b/app/modules/plex/plex.py index c88fe4c25..03245ad9c 100644 --- a/app/modules/plex/plex.py +++ b/app/modules/plex/plex.py @@ -747,7 +747,7 @@ class Plex: videos = self.__fetch_item( item_id, **({"query": query.with_fields(MediaServerField.IDENTITY)} if query is not None else {}) ) - except NotFound, RequestException: + except (NotFound, RequestException): # Plex 删除并重新入库后元数据标识会变化,缓存的旧item_id失效时回退到搜索路径。 logger.warning(f"Plex缓存的电视剧媒体ID {item_id} 已失效,尝试按标题重新搜索:{title}") videos = self.__search_show( diff --git a/app/modules/ugreen/ugreen.py b/app/modules/ugreen/ugreen.py index 87d53bd1e..36c755269 100644 --- a/app/modules/ugreen/ugreen.py +++ b/app/modules/ugreen/ugreen.py @@ -2283,7 +2283,7 @@ class Ugreen: total_count = data.get("TotalRecordCount") try: reached_total = total_count is not None and offset >= int(total_count) - except TypeError, ValueError: + except (TypeError, ValueError): reached_total = False if len(page_items) < page_size or reached_total: return @@ -2315,7 +2315,7 @@ class Ugreen: total_count = data.get("TotalRecordCount") try: return int(total_count) if total_count is not None else None - except TypeError, ValueError: + except (TypeError, ValueError): return None if not self.is_authenticated() or not self._api: return None