fix 豆瓣已订阅显示
This commit is contained in:
@ -122,11 +122,13 @@ def update_subscribe(
|
|||||||
def subscribe_mediaid(
|
def subscribe_mediaid(
|
||||||
mediaid: str,
|
mediaid: str,
|
||||||
season: int = None,
|
season: int = None,
|
||||||
|
title: str = None,
|
||||||
db: Session = Depends(get_db),
|
db: Session = Depends(get_db),
|
||||||
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
||||||
"""
|
"""
|
||||||
根据TMDBID或豆瓣ID查询订阅 tmdb:/douban:
|
根据TMDBID或豆瓣ID查询订阅 tmdb:/douban:
|
||||||
"""
|
"""
|
||||||
|
result = None
|
||||||
if mediaid.startswith("tmdb:"):
|
if mediaid.startswith("tmdb:"):
|
||||||
tmdbid = mediaid[5:]
|
tmdbid = mediaid[5:]
|
||||||
if not tmdbid or not str(tmdbid).isdigit():
|
if not tmdbid or not str(tmdbid).isdigit():
|
||||||
@ -137,8 +139,11 @@ 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)
|
||||||
else:
|
|
||||||
result = None
|
if not result and title:
|
||||||
|
meta = MetaInfo(title)
|
||||||
|
result = Subscribe.get_by_title(db, meta.name)
|
||||||
|
|
||||||
if result and result.sites:
|
if result and result.sites:
|
||||||
result.sites = json.loads(result.sites)
|
result.sites = json.loads(result.sites)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user