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