This commit is contained in:
2026-04-19 19:28:06 +02:00
parent 9e5ddec184
commit b226795731

View File

@@ -198,7 +198,11 @@ def scan_library(library_id: int, library_path: str, db_path: str,
conn.commit() conn.commit()
except Exception as e: 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 done += 1
# Lille pause efter hver scannet fil så GUI ikke hænger # 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, count = scan_library(lib_id, lib_path, db_path,
progress_callback=report) progress_callback=report)
print(json.dumps({"done": count, "total": count, "finished": True}), print(json.dumps({"done": count, "total": count, "finished": True}),
flush=True) flush=True)