mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
fix:
1、兼容B站下播的两种状态 2、更改订阅入库逻辑,加入订阅类型
This commit is contained in:
parent
b7f753ebb6
commit
5321c8d9c0
@ -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"
|
||||
|
||||
@ -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()
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user