db struktur

This commit is contained in:
2026-04-20 00:01:41 +02:00
parent efc30cdbb2
commit f92af40dd7
4 changed files with 90 additions and 40 deletions

View File

@@ -159,11 +159,11 @@ def run_acoustid_scan(db_path: str, api_key: str = "", on_progress=None, stop_ev
conn.row_factory = sqlite3.Row
rows = conn.execute("""
SELECT id, local_path, title, artist
FROM songs
WHERE (mbid IS NULL OR mbid = '')
AND file_missing = 0
AND local_path IS NOT NULL AND local_path != ''
SELECT s.id, s.title, s.artist, f.local_path
FROM songs s
JOIN files f ON f.song_id = s.id AND f.file_missing = 0
WHERE (s.mbid IS NULL OR s.mbid = '')
AND f.local_path IS NOT NULL AND f.local_path != ''
ORDER BY RANDOM()
LIMIT ?
""", (MAX_PER_SESSION,)).fetchall()
@@ -284,4 +284,4 @@ class AcoustIDWorker:
self._stop_event.set()
def is_running(self) -> bool:
return self._running
return self._running