1、兼容B站下播的两种状态
2、更改订阅入库逻辑,加入订阅类型
This commit is contained in:
dingshan 2022-10-31 15:47:40 +08:00
parent b7f753ebb6
commit 5321c8d9c0
2 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ async def _get_live_status(id_: int) -> Optional[str]:
sub = await BilibiliSub.get_sub(id_)
if sub.live_status != live_status:
await BilibiliSub.update_sub_info(id_, live_status=live_status)
if sub.live_status == 0 and live_status == 1:
if sub.live_status in [0, 2] and live_status == 1:
return (
f""
f"{image(cover)}\n"

View File

@ -66,7 +66,7 @@ class BilibiliSub(db.Model):
"""
try:
query = (
await cls.query.where(cls.sub_id == sub_id)
await cls.query.where( (cls.sub_id == sub_id) & (cls.sub_type == sub_type) )
.with_for_update()
.gino.first()
)