🐛 Fix bilibili fav download sql

This commit is contained in:
xtaodada 2023-08-18 23:14:22 +08:00
parent 06301fe648
commit ed8a2125f3
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 2 additions and 24 deletions

View File

@ -272,7 +272,7 @@ async def audio_download(
type=12, type=12,
title=info.get("title", ""), title=info.get("title", ""),
cover=info.get("cover", ""), cover=info.get("cover", ""),
message_id=0, message_id=msg.id if push_id else 0,
file_id=msg.audio.file_id, file_id=msg.audio.file_id,
timestamp=int(time.time()), timestamp=int(time.time()),
) )
@ -412,7 +412,7 @@ async def go_upload(
type=2, type=2,
title=info.get("title", ""), title=info.get("title", ""),
cover=info.get("pic", ""), cover=info.get("pic", ""),
message_id=0, message_id=msg.id if push_id else 0,
file_id=msg.video.file_id, file_id=msg.video.file_id,
timestamp=int(time.time()), timestamp=int(time.time()),
) )

View File

@ -67,17 +67,6 @@ async def process_video(data: Media, m: Message):
msg = await go_upload(video, 0, m, push_id=bilifav_channel) msg = await go_upload(video, 0, m, push_id=bilifav_channel)
if not msg: if not msg:
raise BilibiliFavException raise BilibiliFavException
video_db = BiliFav(
id=data.id,
bv_id=data.bvid.lower(),
type=data.type.value,
title=data.title,
cover=data.cover,
message_id=msg.id,
file_id=msg.video.file_id,
timestamp=int(time.time()),
)
await BiliFavAction.add_bili_fav(video_db)
async def process_audio_from_cache(audio: Audio, audio_db: BiliFav): async def process_audio_from_cache(audio: Audio, audio_db: BiliFav):
@ -102,17 +91,6 @@ async def process_audio(data: Media, m: Message):
msg = await audio_download(audio, m, push_id=bilifav_channel) msg = await audio_download(audio, m, push_id=bilifav_channel)
if not msg: if not msg:
raise BilibiliFavException raise BilibiliFavException
audio_db = BiliFav(
id=data.id,
bv_id=data.bvid.lower(),
type=data.type.value,
title=data.title,
cover=data.cover,
message_id=msg.id,
file_id=msg.audio.file_id,
timestamp=int(time.time()),
)
await BiliFavAction.add_bili_fav(audio_db)
async def check_update(m: Message): async def check_update(m: Message):