Bedre tag sync

This commit is contained in:
2026-04-21 19:18:19 +02:00
parent ec3989e6a4
commit 545cdc6866
7 changed files with 94 additions and 37 deletions

View File

@@ -213,10 +213,16 @@ def run_acoustid_scan(db_path: str, api_key: str = "", on_progress=None, stop_ev
if result:
mbid = result.get("mbid", "")
acoustid = result.get("acoustid", "")
# Opdater acoustid altid, men kun mbid hvis det ikke allerede bruges
conn.execute(
"UPDATE songs SET mbid=?, acoustid=? WHERE id=?",
(mbid or None, acoustid or None, row["id"])
"UPDATE songs SET acoustid=? WHERE id=?",
(acoustid or None, row["id"])
)
if mbid:
conn.execute(
"UPDATE songs SET mbid=? WHERE id=? AND (mbid IS NULL OR mbid='')",
(mbid, row["id"])
)
conn.commit()
found += 1
total_found += 1