Add Logiqx XML DAT parsing (Redump) and clear stale file matches on re-ingest
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user