This commit is contained in:
InfinityPacer 2024-05-19 10:58:09 +08:00
parent de0237f348
commit 111f830664

View File

@ -236,16 +236,19 @@ class Plex:
if item_id: if item_id:
videos = self._plex.fetchItem(item_id) videos = self._plex.fetchItem(item_id)
else: else:
# 兼容年份为空的场景
kwargs = {"year": year} if year else {}
# 根据标题和年份模糊搜索,该结果不够准确 # 根据标题和年份模糊搜索,该结果不够准确
videos = self._plex.library.search(title=title, videos = self._plex.library.search(title=title,
year=year, libtype="show",
libtype="show") **kwargs)
if (not videos if (not videos
and original_title and original_title
and str(original_title) != str(title)): and str(original_title) != str(title)):
videos = self._plex.library.search(title=original_title, videos = self._plex.library.search(title=original_title,
year=year, libtype="show",
libtype="show") **kwargs)
if not videos: if not videos:
return None, {} return None, {}
if isinstance(videos, list): if isinstance(videos, list):