From 443164e3c9bd887332af1e464fc7aed88db174c7 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 2 Sep 2016 13:03:00 -0700 Subject: [PATCH] [RombaSharp] Write rest of UpdateDatabase code --- RombaSharp/RombaSharp.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/RombaSharp/RombaSharp.cs b/RombaSharp/RombaSharp.cs index 3d3365ee..61680f24 100644 --- a/RombaSharp/RombaSharp.cs +++ b/RombaSharp/RombaSharp.cs @@ -423,11 +423,18 @@ namespace SabreTools } } } - } - // At this point, we should have everything that needs to be added, added - // Now we have to remove any files associated with Dats that are no longer - // around. + // Now loop through and remove all references to old Dats + // TODO: Remove orphaned files as well + foreach (string dathash in databaseDats) + { + query = "DELETE FROM data WHERE key=\"dat\" AND value=\"" + dathash + "\""; + using (SqliteCommand slc = new SqliteCommand(query, dbc)) + { + slc.ExecuteNonQuery(); + } + } + } } } }