This commit is contained in:
2026-04-14 16:21:06 +02:00
parent 287477753e
commit 460b41a8c5
5 changed files with 301 additions and 1 deletions

View File

@@ -565,6 +565,33 @@ class MainWindow(QMainWindow):
pass
QTimer.singleShot(5000, self.start_background_scan)
# Start AcoustID fingerprinting efter 60 sekunder hvis aktiveret
if self._settings.get("acoustid_enabled", False):
QTimer.singleShot(60000, self._start_acoustid)
def _start_acoustid(self):
"""Start AcoustID fingerprinting i baggrunden."""
from local.acoustid_worker import AcoustIDWorker, find_fpcalc
from local.local_db import DB_PATH
if not find_fpcalc():
logger.info("AcoustID: fpcalc ikke fundet — springer over")
return
if not hasattr(self, "_acoustid_worker"):
self._acoustid_worker = AcoustIDWorker(str(DB_PATH))
if self._acoustid_worker.is_running():
return
def on_progress(done, total, title):
if total > 0 and done % 10 == 0:
self._set_status(
f"AcoustID: {done}/{total}{title}", 3000
)
self._acoustid_worker.start(on_progress=on_progress)
self._set_status("AcoustID fingerprinting startet i baggrunden", 4000)
def start_background_scan(self):
"""Start scanning af alle aktive biblioteker i baggrunden."""