fix subscribe
This commit is contained in:
@ -95,7 +95,8 @@ class SubscribeChain(ChainBase):
|
||||
'lack_episode': kwargs.get('total_episode')
|
||||
})
|
||||
# 添加订阅
|
||||
sid, err_msg = self.subscribehelper.add(mediainfo, doubanid=doubanid, season=season, **kwargs)
|
||||
sid, err_msg = self.subscribehelper.add(mediainfo, doubanid=doubanid,
|
||||
season=season, username=username, **kwargs)
|
||||
if not sid:
|
||||
logger.error(f'{mediainfo.title_year} {err_msg}')
|
||||
if not exist_ok and message:
|
||||
@ -107,9 +108,13 @@ class SubscribeChain(ChainBase):
|
||||
userid=userid)
|
||||
elif message:
|
||||
logger.info(f'{mediainfo.title_year}{metainfo.season} 添加订阅成功')
|
||||
if username or userid:
|
||||
text = f"评分:{mediainfo.vote_average},来自用户:{username or userid}"
|
||||
else:
|
||||
text = f"评分:{mediainfo.vote_average}"
|
||||
# 广而告之
|
||||
self.post_message(title=f"{mediainfo.title_year}{metainfo.season} 已添加订阅",
|
||||
text=f"评分:{mediainfo.vote_average},来自用户:{username or userid}",
|
||||
text=text,
|
||||
image=mediainfo.get_message_image())
|
||||
# 返回结果
|
||||
return sid, ""
|
||||
|
@ -50,6 +50,8 @@ class Subscribe(Base):
|
||||
state = Column(String, nullable=False, index=True, default='N')
|
||||
# 最后更新时间
|
||||
last_update = Column(String)
|
||||
# 订阅用户
|
||||
username = Column(String)
|
||||
|
||||
@staticmethod
|
||||
def exists(db: Session, tmdbid: int, season: int = None):
|
||||
|
@ -43,6 +43,8 @@ class Subscribe(BaseModel):
|
||||
state: Optional[str] = None
|
||||
# 最后更新时间
|
||||
last_update: Optional[str] = None
|
||||
# 订阅用户
|
||||
username: Optional[str] = None
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
Reference in New Issue
Block a user