From b763103e796aaa83d226355c8bca5fe150398e65 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 16 Apr 2016 21:13:22 -0700 Subject: [PATCH] Add lastupdated to sort for merged --- DATabase/Generate.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/DATabase/Generate.cs b/DATabase/Generate.cs index d9c62d3a..063a025a 100644 --- a/DATabase/Generate.cs +++ b/DATabase/Generate.cs @@ -287,7 +287,6 @@ namespace SabreTools /// /// Preprocess the rom data that is to be included in the outputted DAT /// - /// To make this even more accurate, files with a more recent "LastUpdated" should be considered the parent if all else is the same. /// A List of RomData objects containing all information about the files public List ProcessRoms() { @@ -301,8 +300,8 @@ namespace SabreTools string query = @" SELECT DISTINCT systems.manufacturer AS manufacturer, systems.system AS system, systems.id AS systemid, sources.name AS source, sources.url AS url, sources.id AS sourceid, - games.name AS game, files.name AS name, files.type AS type, checksums.size AS size, checksums.crc AS crc, - checksums.md5 AS md5, checksums.sha1 AS sha1 + games.name AS game, files.name AS name, files.type AS type, files.lastupdated AS lastupdated, + checksums.size AS size, checksums.crc AS crc, checksums.md5 AS md5, checksums.sha1 AS sha1 FROM systems JOIN games ON systems.id=games.system @@ -317,7 +316,7 @@ JOIN checksums (_systems != "" && _sources != "" ? " AND" : "") + (_systems != "" ? " systems.id in (" + _systems + ")" : "") + "\nORDER BY " + - (merged ? "checksums.size, checksums.crc, systems.id, sources.id, checksums.md5, checksums.sha1" + (merged ? "checksums.size, checksums.crc, systems.id, sources.id, files.lastupdated, checksums.md5, checksums.sha1" : "systems.id, sources.id, games.name, files.name"); using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))