oopsie: handle duplicate playlist entries from spotify api (INSERT >> INSERT OR REPLACE)

This commit is contained in:
Markury
2026-07-15 21:30:10 -04:00
parent 3d7d3ded1c
commit 3b67a03ad2

View File

@@ -139,7 +139,7 @@ export async function upsertPlaylists(playlists: any[]): Promise<void> {
// Insert new playlists // Insert new playlists
for (const playlist of playlists) { for (const playlist of playlists) {
await database.execute( await database.execute(
`INSERT INTO spotify_playlists (id, name, track_count, owner_name, image_url, cached_at) `INSERT OR REPLACE INTO spotify_playlists (id, name, track_count, owner_name, image_url, cached_at)
VALUES ($1, $2, $3, $4, $5, $6)`, VALUES ($1, $2, $3, $4, $5, $6)`,
[ [
playlist.id, playlist.id,