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
|
||||
if await BiliFavAction.get_by_bv_id(data.bvid, fav=True):
|
||||
continue
|
||||
if await BiliFavAction.get_by_id(data.id, fav=True):
|
||||
continue
|
||||
n = await m.reply(f"处理 {data.type.name} {data.bvid} 中...")
|
||||
try:
|
||||
if data.type == MediaType.video:
|
||||
|
@ -10,6 +10,8 @@ from models.models.bilifav import BiliFav
|
||||
class BiliFavAction:
|
||||
@staticmethod
|
||||
async def get_by_id(id_: int, fav: bool = False) -> Optional[BiliFav]:
|
||||
if not id_:
|
||||
return None
|
||||
async with sqlite.session() as session:
|
||||
session = cast(AsyncSession, session)
|
||||
statement = select(BiliFav).where(BiliFav.id == id_)
|
||||
|
Loading…
Reference in New Issue
Block a user