mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-12-02 00:46:27 +08:00
fix(modules): parenthesize multi-exception clauses in plex and ugreen
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user