refactor: 统一将布尔判断 if var:if not var: 更改为显式的 if var is not None:if var is None: 以正确处理 None 值。

This commit is contained in:
jxxghp
2026-02-02 13:49:32 +08:00
parent 7b8cd37a9b
commit d469c2d3f9
9 changed files with 32 additions and 32 deletions
+4 -4
View File
@@ -421,7 +421,7 @@ class Emby:
if str(tmdb_id) != str(item_info.tmdbid):
return None, {}
# 查集的信息
if not season:
if season is None:
season = None
try:
url = f"{self._host}emby/Shows/{item_id}/Episodes"
@@ -437,12 +437,12 @@ class Emby:
season_episodes = {}
for res_item in res_items:
season_index = res_item.get("ParentIndexNumber")
if not season_index:
if season_index is None:
continue
if season and season != season_index:
if season is not None and season != season_index:
continue
episode_index = res_item.get("IndexNumber")
if not episode_index:
if episode_index is None:
continue
if season_index not in season_episodes:
season_episodes[season_index] = []