mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 04:10:02 +08:00
fix:
1、兼容B站下播的两种状态 2、更改订阅入库逻辑,加入订阅类型
This commit is contained in:
@@ -230,7 +230,7 @@ async def _get_live_status(id_: int) -> Optional[str]:
|
|||||||
sub = await BilibiliSub.get_sub(id_)
|
sub = await BilibiliSub.get_sub(id_)
|
||||||
if sub.live_status != live_status:
|
if sub.live_status != live_status:
|
||||||
await BilibiliSub.update_sub_info(id_, 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 (
|
return (
|
||||||
f""
|
f""
|
||||||
f"{image(cover)}\n"
|
f"{image(cover)}\n"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class BilibiliSub(db.Model):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
query = (
|
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()
|
.with_for_update()
|
||||||
.gino.first()
|
.gino.first()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user