Klar v1
This commit is contained in:
@@ -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)
|
||||||
Reference in New Issue
Block a user