Comment out code in preparation for eventual removal

The next step is to include the "source DAT name" in the dupe field instead of just "false". It will still be changed to "true" on merging, however. This will allow for multi-dat AB output since each unique source can have the non-dupe roms outputted. This will require a change in WriteToDat2 as well to enable "AB" mode, or at least a field called source that is default empty. If it's not empty, it tries to write out ONLY things that match that source. Maybe merge it in to the "diff" mechanic. Actually, if it's a flag, it will just output every variant: All in A, All in B, All in both, All not in both. Pretty easy.
This commit is contained in:
Matt Nadareski
2016-04-27 16:11:29 -07:00
parent 0d22715fa4
commit bfdb031438
2 changed files with 11 additions and 3 deletions

View File

@@ -113,6 +113,7 @@ namespace SabreTools
_logger.Log("Adding DAT: " + input); _logger.Log("Adding DAT: " + input);
RomManipulation.Parse2(input, 0, 0, _dedup, dbc, _logger); RomManipulation.Parse2(input, 0, 0, _dedup, dbc, _logger);
/*
List<RomData> B = RomManipulation.Parse(input, 0, 0, _logger); List<RomData> B = RomManipulation.Parse(input, 0, 0, _logger);
if (_diff) if (_diff)
{ {
@@ -122,6 +123,7 @@ namespace SabreTools
{ {
A.AddRange(B); 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 // 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()); _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(); dbc.Close();
// If we're in Alldiff mode, we can only use the first 2 inputs // 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); 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 we want a merged list, send it for merging before outputting
if (_dedup) if (_dedup)
{ {
@@ -161,6 +165,7 @@ namespace SabreTools
// Now write the file out // Now write the file out
Output.WriteToDat(_name, _desc, _version, _date, _cat, _author, _forceunpack, _old, "", A, _logger); Output.WriteToDat(_name, _desc, _version, _date, _cat, _author, _forceunpack, _old, "", A, _logger);
*/
return true; return true;
} }

View File

@@ -139,11 +139,13 @@ namespace SabreTools.Helper
/// <param name="author">DAT author</param> /// <param name="author">DAT author</param>
/// <param name="forceunpack">Force all sets to be unzipped</param> /// <param name="forceunpack">Force all sets to be unzipped</param>
/// <param name="old">Set output mode to old-style DAT</param> /// <param name="old">Set output mode to old-style DAT</param>
/// <param name="diff">Only output files that don't have dupes</param>
/// <param name="outDir">Set the output directory</param> /// <param name="outDir">Set the output directory</param>
/// <param name="dbc">Database connection representing the roms to be written</param> /// <param name="dbc">Database connection representing the roms to be written</param>
/// <param name="logger">Logger object for console and/or file output</param> /// <param name="logger">Logger object for console and/or file output</param>
/// <returns>Tru if the DAT was written correctly, false otherwise</returns> /// <returns>Tru if the DAT was written correctly, false otherwise</returns>
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 it's empty, use the current folder
if (outDir.Trim() == "") if (outDir.Trim() == "")
@@ -193,7 +195,8 @@ namespace SabreTools.Helper
// Write out each of the machines and roms // Write out each of the machines and roms
string lastgame = ""; 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()) while (sldr.Read())
{ {