mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
A preview of things to come...
This commit is contained in:
@@ -11,7 +11,9 @@ namespace DATabase
|
|||||||
{
|
{
|
||||||
// Private instance variables
|
// Private instance variables
|
||||||
private int _systems;
|
private int _systems;
|
||||||
|
//private string _systems;
|
||||||
private int _sources;
|
private int _sources;
|
||||||
|
//private string _sources;
|
||||||
private string _connectionString;
|
private string _connectionString;
|
||||||
private bool _norename;
|
private bool _norename;
|
||||||
private bool _old;
|
private bool _old;
|
||||||
@@ -19,6 +21,7 @@ namespace DATabase
|
|||||||
// Private required variables
|
// Private required variables
|
||||||
private Dictionary<int, string> _headers;
|
private Dictionary<int, string> _headers;
|
||||||
|
|
||||||
|
//public Generate(string systems, string sources, string connectionString, bool norename = false, bool old = false)
|
||||||
public Generate(int systems, int sources, string connectionString, bool norename = false, bool old = false)
|
public Generate(int systems, int sources, string connectionString, bool norename = false, bool old = false)
|
||||||
{
|
{
|
||||||
_systems = systems;
|
_systems = systems;
|
||||||
@@ -41,8 +44,10 @@ namespace DATabase
|
|||||||
{
|
{
|
||||||
// Get the system name, if applicable
|
// Get the system name, if applicable
|
||||||
string systemname = "ALL";
|
string systemname = "ALL";
|
||||||
|
//if (_systems != "")
|
||||||
if (_systems != -1)
|
if (_systems != -1)
|
||||||
{
|
{
|
||||||
|
//string query = "SELECT manufacturer, system FROM systems WHERE id in (" + _systems + ")";
|
||||||
string query = "SELECT manufacturer, system FROM systems WHERE id=" + _systems;
|
string query = "SELECT manufacturer, system FROM systems WHERE id=" + _systems;
|
||||||
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
||||||
{
|
{
|
||||||
@@ -54,6 +59,7 @@ namespace DATabase
|
|||||||
// If there are no games for this combination, return nothing
|
// If there are no games for this combination, return nothing
|
||||||
if (!sldr.HasRows)
|
if (!sldr.HasRows)
|
||||||
{
|
{
|
||||||
|
//Console.WriteLine("No system could be found with id in \"" + _systems + "\". Please check and try again.");
|
||||||
Console.WriteLine("No system could be found with id " + _systems + ". Please check and try again.");
|
Console.WriteLine("No system could be found with id " + _systems + ". Please check and try again.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -67,8 +73,10 @@ namespace DATabase
|
|||||||
}
|
}
|
||||||
|
|
||||||
string sourcename = "Merged";
|
string sourcename = "Merged";
|
||||||
|
// if (_sources != "")
|
||||||
if (_sources != -1)
|
if (_sources != -1)
|
||||||
{
|
{
|
||||||
|
//string query = "SELECT name FROM sources WHERE id in (" + _sources + ")";
|
||||||
string query = "SELECT name FROM sources WHERE id=" + _sources;
|
string query = "SELECT name FROM sources WHERE id=" + _sources;
|
||||||
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
||||||
{
|
{
|
||||||
@@ -80,6 +88,7 @@ namespace DATabase
|
|||||||
// If there are no games for this combination, return nothing
|
// If there are no games for this combination, return nothing
|
||||||
if (!sldr.HasRows)
|
if (!sldr.HasRows)
|
||||||
{
|
{
|
||||||
|
//Console.WriteLine("No source could be found with id in \"" + _sources + "\". Please check and try again.");
|
||||||
Console.WriteLine("No source could be found with id " + _sources + ". Please check and try again.");
|
Console.WriteLine("No source could be found with id " + _sources + ". Please check and try again.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -229,8 +238,10 @@ JOIN files
|
|||||||
JOIN checksums
|
JOIN checksums
|
||||||
ON files.id=checksums.file" +
|
ON files.id=checksums.file" +
|
||||||
(!sysmerged || !srcmerged ? "\nWHERE" : "") +
|
(!sysmerged || !srcmerged ? "\nWHERE" : "") +
|
||||||
|
//(!srcmerged ? " sources.id in (" + _sources + ")" : "") +
|
||||||
(!srcmerged ? " sources.id=" + _sources : "") +
|
(!srcmerged ? " sources.id=" + _sources : "") +
|
||||||
(!srcmerged && !sysmerged ? " AND" : "") +
|
(!srcmerged && !sysmerged ? " AND" : "") +
|
||||||
|
//(!sysmerged ? " systems.id in (" + _systems + ")" : "") + "\n" +
|
||||||
(!sysmerged ? " systems.id=" + _systems : "") + "\n" +
|
(!sysmerged ? " systems.id=" + _systems : "") + "\n" +
|
||||||
"\nORDER BY " +
|
"\nORDER BY " +
|
||||||
(merged ? "checksums.size, checksums.crc, checksums.md5, checksums.sha1"
|
(merged ? "checksums.size, checksums.crc, checksums.md5, checksums.sha1"
|
||||||
|
|||||||
Reference in New Issue
Block a user