fix(modules): parenthesize multi-exception clauses in plex and ugreen

This commit is contained in:
jxxghp
2026-11-23 17:35:54 +08:00
parent fa9416d652
commit 9640182515
2 changed files with 3 additions and 3 deletions

View File

@@ -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(

View File

@@ -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