From a0af2f4b68c9467597191336c5b6455e66a60e6b Mon Sep 17 00:00:00 2001 From: Edward <73746306+WangEdward@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:39:03 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20tmdb=20=E5=90=8C=E5=90=8D=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=B7=B2=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/subscribe.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/api/endpoints/subscribe.py b/app/api/endpoints/subscribe.py index a1c42989..14dde24a 100644 --- a/app/api/endpoints/subscribe.py +++ b/app/api/endpoints/subscribe.py @@ -140,12 +140,13 @@ def subscribe_mediaid( if not doubanid: return Subscribe() result = Subscribe.get_by_doubanid(db, doubanid) - - if not result and title: - meta = MetaInfo(title) - if season: - meta.begin_season = season - result = Subscribe.get_by_title(db, title=meta.name, season=meta.begin_season) + # 豆瓣已订阅如果 id 搜索无结果使用标题搜索 + # 会造成同名结果也会被返回 + if not result and title: + meta = MetaInfo(title) + if season: + meta.begin_season = season + result = Subscribe.get_by_title(db, title=meta.name, season=meta.begin_season) if result and result.sites: result.sites = json.loads(result.sites)