mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-21 22:58:09 +00:00
🐛 Fix bilibili fav audio cache
This commit is contained in:
parent
ed8a2125f3
commit
224bf15b72
@ -110,6 +110,8 @@ async def check_update(m: Message):
|
|||||||
continue
|
continue
|
||||||
if await BiliFavAction.get_by_bv_id(data.bvid, fav=True):
|
if await BiliFavAction.get_by_bv_id(data.bvid, fav=True):
|
||||||
continue
|
continue
|
||||||
|
if await BiliFavAction.get_by_id(data.id, fav=True):
|
||||||
|
continue
|
||||||
n = await m.reply(f"处理 {data.type.name} {data.bvid} 中...")
|
n = await m.reply(f"处理 {data.type.name} {data.bvid} 中...")
|
||||||
try:
|
try:
|
||||||
if data.type == MediaType.video:
|
if data.type == MediaType.video:
|
||||||
|
@ -10,6 +10,8 @@ from models.models.bilifav import BiliFav
|
|||||||
class BiliFavAction:
|
class BiliFavAction:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def get_by_id(id_: int, fav: bool = False) -> Optional[BiliFav]:
|
async def get_by_id(id_: int, fav: bool = False) -> Optional[BiliFav]:
|
||||||
|
if not id_:
|
||||||
|
return None
|
||||||
async with sqlite.session() as session:
|
async with sqlite.session() as session:
|
||||||
session = cast(AsyncSession, session)
|
session = cast(AsyncSession, session)
|
||||||
statement = select(BiliFav).where(BiliFav.id == id_)
|
statement = select(BiliFav).where(BiliFav.id == id_)
|
||||||
|
Loading…
Reference in New Issue
Block a user