diff --git a/DATabase/MergeDiff.cs b/DATabase/MergeDiff.cs index 19bea00d..3c730d88 100644 --- a/DATabase/MergeDiff.cs +++ b/DATabase/MergeDiff.cs @@ -113,6 +113,7 @@ namespace SabreTools _logger.Log("Adding DAT: " + input); RomManipulation.Parse2(input, 0, 0, _dedup, dbc, _logger); + /* List B = RomManipulation.Parse(input, 0, 0, _logger); if (_diff) { @@ -122,6 +123,7 @@ namespace SabreTools { A.AddRange(B); } + */ } // Until I find a way to output the roms from the db, here's just a count of the items in it @@ -129,7 +131,8 @@ namespace SabreTools { _logger.Log("Total number of lines in database: " + slc.ExecuteScalar()); } - Output.WriteToDat2(_name + "-db", _desc + "-db", _version, _date, _cat, _author, _forceunpack, _old, "", dbc, _logger); + Output.WriteToDat2(_name + "-db", _desc + "-db", _version, _date, _cat, _author, _forceunpack, _old, _diff, "", dbc, _logger); + dbc.Close(); // If we're in Alldiff mode, we can only use the first 2 inputs @@ -150,6 +153,7 @@ namespace SabreTools Output.WriteToDat(_name + "-inboth", _desc + "-inboth", _version, _date, _cat, _author, _forceunpack, _old, "", BothAB, _logger); } + /* // If we want a merged list, send it for merging before outputting if (_dedup) { @@ -161,6 +165,7 @@ namespace SabreTools // Now write the file out Output.WriteToDat(_name, _desc, _version, _date, _cat, _author, _forceunpack, _old, "", A, _logger); + */ return true; } diff --git a/SabreHelper/Output.cs b/SabreHelper/Output.cs index fb68e0aa..b4f87d1b 100644 --- a/SabreHelper/Output.cs +++ b/SabreHelper/Output.cs @@ -139,11 +139,13 @@ namespace SabreTools.Helper /// DAT author /// Force all sets to be unzipped /// Set output mode to old-style DAT + /// Only output files that don't have dupes /// Set the output directory /// Database connection representing the roms to be written /// Logger object for console and/or file output /// Tru if the DAT was written correctly, false otherwise - public static bool WriteToDat2(string name, string description, string version, string date, string category, string author, bool forceunpack, bool old, string outDir, SqliteConnection dbc, Logger logger) + public static bool WriteToDat2(string name, string description, string version, string date, string category, + string author, bool forceunpack, bool old, bool diff, string outDir, SqliteConnection dbc, Logger logger) { // If it's empty, use the current folder if (outDir.Trim() == "") @@ -193,7 +195,8 @@ namespace SabreTools.Helper // Write out each of the machines and roms string lastgame = ""; - using (SqliteDataReader sldr = (new SqliteCommand("SELECT * FROM roms ORDER BY game, name", dbc).ExecuteReader())) + string query = "SELECT * FROM roms" + (diff ? " WHERE dupe='false'" : "") + " ORDER BY game, name"; + using (SqliteDataReader sldr = (new SqliteCommand(query, dbc).ExecuteReader())) { while (sldr.Read()) {