Skip to content

Commit

Permalink
Merge pull request #1480 from WangEdward/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Feb 15, 2024
2 parents cbffddc + a0af2f4 commit 595ca63
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/api/endpoints/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 595ca63

Please sign in to comment.