Add Logiqx XML DAT parsing (Redump) and clear stale file matches on re-ingest

This commit is contained in:
2026-09-07 16:20:39 -04:00
parent 922c01d17c
commit 2d599141f9
2 changed files with 78 additions and 16 deletions
+6
View File
@@ -37,6 +37,12 @@ def ingest_dat(conn, path):
existing = conn.execute("SELECT id FROM dats WHERE name = ?", (dat_name,)).fetchone()
if existing:
dat_id = existing["id"]
# Files that resolved to a release in this DAT must be re-identified
# against the new catalog (the release ids are about to be recycled).
conn.execute(
"UPDATE files SET release_id = NULL WHERE release_id IN (SELECT id FROM releases WHERE dat_id = ?)",
(dat_id,),
)
conn.execute("DELETE FROM roms WHERE release_id IN (SELECT id FROM releases WHERE dat_id = ?)", (dat_id,))
conn.execute("DELETE FROM releases WHERE dat_id = ?", (dat_id,))
conn.execute(