mirror of
https://github.com/markuryy/shark.git
synced 2026-07-26 07:01:01 +00:00
oopsie: handle duplicate playlist entries from spotify api (INSERT >> INSERT OR REPLACE)
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user