Merge pull request #2115 from InfinityPacer/main

This commit is contained in:
jxxghp 2024-05-19 11:02:19 +08:00 committed by GitHub
commit cfdc8fb2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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):