Merge pull request #1480 from WangEdward/main

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

View File

@ -140,12 +140,13 @@ def subscribe_mediaid(
if not doubanid: if not doubanid:
return Subscribe() return Subscribe()
result = Subscribe.get_by_doubanid(db, doubanid) result = Subscribe.get_by_doubanid(db, doubanid)
# 豆瓣已订阅如果 id 搜索无结果使用标题搜索
if not result and title: # 会造成同名结果也会被返回
meta = MetaInfo(title) if not result and title:
if season: meta = MetaInfo(title)
meta.begin_season = season if season:
result = Subscribe.get_by_title(db, title=meta.name, season=meta.begin_season) meta.begin_season = season
result = Subscribe.get_by_title(db, title=meta.name, season=meta.begin_season)
if result and result.sites: if result and result.sites:
result.sites = json.loads(result.sites) result.sites = json.loads(result.sites)