mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Remove unnecessary switch
This commit is contained in:
@@ -455,11 +455,10 @@ namespace SabreTools.Helper
|
|||||||
if (merge)
|
if (merge)
|
||||||
{
|
{
|
||||||
// If the rom doesn't exist, add it to the database
|
// If the rom doesn't exist, add it to the database
|
||||||
string query = @"SELECT sha1 FROM roms WHERE size=" + size +
|
string query = @"SELECT id FROM roms WHERE size=" + size +
|
||||||
(xtr.GetAttribute("crc") != null ? " AND crc='" + xtr.GetAttribute("crc").ToLowerInvariant().Trim() + "'" : "") +
|
(xtr.GetAttribute("crc") != null ? " AND (crc='" + xtr.GetAttribute("crc").ToLowerInvariant().Trim() + "' OR crc='')" : "") +
|
||||||
(xtr.GetAttribute("md5") != null ? " AND md5='" + xtr.GetAttribute("md5").ToLowerInvariant().Trim() + "'" : "") +
|
(xtr.GetAttribute("md5") != null ? " AND (md5='" + xtr.GetAttribute("md5").ToLowerInvariant().Trim() + "' OR md5='')" : "") +
|
||||||
(xtr.GetAttribute("sha1") != null ? " AND sha1='" + xtr.GetAttribute("sha1").ToLowerInvariant().Trim() + "'" : "") +
|
(xtr.GetAttribute("sha1") != null ? " AND (sha1='" + xtr.GetAttribute("sha1").ToLowerInvariant().Trim() + "' OR sha1='')" : "");
|
||||||
(merge ? "" : " AND game='" + tempname.Replace("'", "''") + "' AND name='" + xtr.GetAttribute("name").Replace("'", "''") + "' AND sysid=" + sysid + " AND srcid=" + srcid);
|
|
||||||
|
|
||||||
using (SqliteCommand slc = new SqliteCommand(query, dbc))
|
using (SqliteCommand slc = new SqliteCommand(query, dbc))
|
||||||
{
|
{
|
||||||
@@ -491,8 +490,7 @@ VALUES ('" + tempname.Replace("'", "''") + "', '" +
|
|||||||
query = @"UPDATE roms SET dupe='true' WHERE size=" + size +
|
query = @"UPDATE roms SET dupe='true' WHERE size=" + size +
|
||||||
(xtr.GetAttribute("crc") != null ? " AND crc='" + xtr.GetAttribute("crc").ToLowerInvariant().Trim() + "'" : "") +
|
(xtr.GetAttribute("crc") != null ? " AND crc='" + xtr.GetAttribute("crc").ToLowerInvariant().Trim() + "'" : "") +
|
||||||
(xtr.GetAttribute("md5") != null ? " AND md5='" + xtr.GetAttribute("md5").ToLowerInvariant().Trim() + "'" : "") +
|
(xtr.GetAttribute("md5") != null ? " AND md5='" + xtr.GetAttribute("md5").ToLowerInvariant().Trim() + "'" : "") +
|
||||||
(xtr.GetAttribute("sha1") != null ? " AND sha1='" + xtr.GetAttribute("sha1").ToLowerInvariant().Trim() + "'" : "") +
|
(xtr.GetAttribute("sha1") != null ? " AND sha1='" + xtr.GetAttribute("sha1").ToLowerInvariant().Trim() + "'" : "");
|
||||||
(merge ? "" : " AND game='" + tempname.Replace("'", "''") + "' AND name='" + xtr.GetAttribute("name").Replace("'", "''") + "' AND sysid=" + sysid + " AND srcid=" + srcid);
|
|
||||||
|
|
||||||
using (SqliteCommand sslc = new SqliteCommand(query, dbc))
|
using (SqliteCommand sslc = new SqliteCommand(query, dbc))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user