From b226795731a4a1fcf26e855d297da53a2dfe372b Mon Sep 17 00:00:00 2001 From: Carsten Kvist Date: Sun, 19 Apr 2026 19:28:06 +0200 Subject: [PATCH] Klar v1 --- linedance-app/local/scanner.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/linedance-app/local/scanner.py b/linedance-app/local/scanner.py index 8a570189..284f3db6 100644 --- a/linedance-app/local/scanner.py +++ b/linedance-app/local/scanner.py @@ -198,7 +198,11 @@ def scan_library(library_id: int, library_path: str, db_path: str, conn.commit() except Exception as e: - logger.warning(f"Scan fejl {fp.name}: {e}") + # UNIQUE constraint er forventet og ufarlig — sang findes allerede + if "UNIQUE constraint" in str(e): + logger.debug(f"Sang allerede i DB: {fp.name}") + else: + logger.warning(f"Scan fejl {fp.name}: {e}") done += 1 # Lille pause efter hver scannet fil så GUI ikke hænger @@ -248,4 +252,4 @@ if __name__ == "__main__": count = scan_library(lib_id, lib_path, db_path, progress_callback=report) print(json.dumps({"done": count, "total": count, "finished": True}), - flush=True) + flush=True) \ No newline at end of file