1
0

update: the SQL to insert cover_url into songs table as well

This commit is contained in:
alikia2x (寒寒) 2025-10-14 01:51:26 +08:00
parent efa1a71512
commit 2b04092f0a

View File

@ -18,11 +18,12 @@ export async function collectSongs() {
export async function insertIntoSongs(sql: Psql, aid: number) {
await sql`
INSERT INTO songs (aid, published_at, duration)
INSERT INTO songs (aid, published_at, duration, image)
VALUES (
$1,
(SELECT published_at FROM bilibili_metadata WHERE aid = ${aid}),
(SELECT duration FROM bilibili_metadata WHERE aid = ${aid})
(SELECT duration FROM bilibili_metadata WHERE aid = ${aid}),
(SELECT cover_url FROM bilibili_metadata WHERE aid = ${aid})
)
ON CONFLICT DO NOTHING
`;