mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Make the file dictionary transparent
This commit is contained in:
@@ -443,9 +443,9 @@ namespace SabreTools
|
||||
// Loop through the Dictionary and add all data
|
||||
_logger.User("Adding new DAT information");
|
||||
start = DateTime.Now;
|
||||
foreach (string key in datroot.Files.Keys)
|
||||
foreach (string key in datroot.Keys())
|
||||
{
|
||||
foreach (Rom value in datroot.Files[key])
|
||||
foreach (Rom value in datroot[key])
|
||||
{
|
||||
AddDatToDatabase(value, dbc);
|
||||
}
|
||||
@@ -481,7 +481,7 @@ namespace SabreTools
|
||||
|
||||
// If the Dat wasn't empty, add the information
|
||||
SqliteCommand slc = new SqliteCommand();
|
||||
if (tempdat.Files.Count != 0)
|
||||
if (tempdat.Count != 0)
|
||||
{
|
||||
string crcquery = "INSERT OR IGNORE INTO crc (crc) VALUES";
|
||||
string md5query = "INSERT OR IGNORE INTO md5 (md5) VALUES";
|
||||
|
||||
@@ -106,16 +106,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Add to the Dat
|
||||
if (need.Files.ContainsKey(key))
|
||||
{
|
||||
need.Files[key].Add(rom);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<DatItem> temp = new List<DatItem>();
|
||||
temp.Add(rom);
|
||||
need.Files.Add(key, temp);
|
||||
}
|
||||
need.Add(key, rom);
|
||||
}
|
||||
}
|
||||
// Otherwise, just add the file to the list
|
||||
@@ -145,16 +136,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Add to the Dat
|
||||
if (need.Files.ContainsKey(key))
|
||||
{
|
||||
need.Files[key].Add(rom);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<DatItem> temp = new List<DatItem>();
|
||||
temp.Add(rom);
|
||||
need.Files.Add(key, temp);
|
||||
}
|
||||
need.Add(key, rom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user