From 82fbae7942cd6d58376c95bfb8678347c87c657b Mon Sep 17 00:00:00 2001 From: iou1name Date: Sat, 22 Mar 2025 21:26:12 -0400 Subject: [PATCH] update existing playlist --- load_playlist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/load_playlist.py b/load_playlist.py index 1d17b35..31c479e 100644 --- a/load_playlist.py +++ b/load_playlist.py @@ -31,7 +31,8 @@ async def load_playlist(path): data = [(pid, line) for line in data] stmt = await conn.prepare( - "INSERT INTO playlist_track (playlist_id, filepath) VALUES ($1, $2)") + "INSERT INTO playlist_track (playlist_id, filepath) VALUES ($1, $2) " + "ON CONFLICT(playlist_id, filepath) DO NOTHING") await stmt.executemany(data) print("Done. Loaded", len(data), "tracks")