fix 豆瓣已订阅显示
This commit is contained in:
parent
61d71b32ff
commit
5a07732712
@ -142,7 +142,9 @@ def subscribe_mediaid(
|
||||
|
||||
if not result and title:
|
||||
meta = MetaInfo(title)
|
||||
result = Subscribe.get_by_title(db, meta.name)
|
||||
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)
|
||||
|
@ -97,7 +97,10 @@ class Subscribe(Base):
|
||||
|
||||
@staticmethod
|
||||
@db_query
|
||||
def get_by_title(db: Session, title: str):
|
||||
def get_by_title(db: Session, title: str, season: int = None):
|
||||
if season:
|
||||
return db.query(Subscribe).filter(Subscribe.name == title,
|
||||
Subscribe.season == season).first()
|
||||
return db.query(Subscribe).filter(Subscribe.name == title).first()
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
x
Reference in New Issue
Block a user