From 111f83066498aa691aa4051cebab9ef0efd9d94a Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Sun, 19 May 2024 10:58:09 +0800 Subject: [PATCH] fix #2104 --- app/modules/plex/plex.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/modules/plex/plex.py b/app/modules/plex/plex.py index ac14c667..77eeec23 100644 --- a/app/modules/plex/plex.py +++ b/app/modules/plex/plex.py @@ -236,16 +236,19 @@ class Plex: if item_id: videos = self._plex.fetchItem(item_id) else: + # 兼容年份为空的场景 + kwargs = {"year": year} if year else {} # 根据标题和年份模糊搜索,该结果不够准确 videos = self._plex.library.search(title=title, - year=year, - libtype="show") + libtype="show", + **kwargs) if (not videos and original_title and str(original_title) != str(title)): videos = self._plex.library.search(title=original_title, - year=year, - libtype="show") + libtype="show", + **kwargs) + if not videos: return None, {} if isinstance(videos, list):