mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DATFromDir] Force file order parity
This commit is contained in:
@@ -155,7 +155,9 @@ namespace SabreTools
|
|||||||
|
|
||||||
// Then process each of the subfolders themselves
|
// Then process each of the subfolders themselves
|
||||||
string basePathBackup = _basePath;
|
string basePathBackup = _basePath;
|
||||||
foreach (string item in Directory.EnumerateDirectories(_basePath))
|
List<string> dirs = Directory.EnumerateDirectories(_basePath).ToList();
|
||||||
|
dirs.Sort(Style.CompareNumeric);
|
||||||
|
foreach (string item in dirs)
|
||||||
{
|
{
|
||||||
if (_datdata.Type != "SuperDAT")
|
if (_datdata.Type != "SuperDAT")
|
||||||
{
|
{
|
||||||
@@ -164,7 +166,9 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool items = false;
|
bool items = false;
|
||||||
foreach (string subitem in Directory.EnumerateFiles(item, "*", SearchOption.AllDirectories))
|
List<string> files = Directory.EnumerateFiles(item, "*", SearchOption.AllDirectories).ToList();
|
||||||
|
files.Sort(Style.CompareNumeric);
|
||||||
|
foreach (string subitem in files)
|
||||||
{
|
{
|
||||||
items = true;
|
items = true;
|
||||||
lastparent = ProcessPossibleArchive(subitem, sw, lastparent);
|
lastparent = ProcessPossibleArchive(subitem, sw, lastparent);
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ namespace SabreTools
|
|||||||
foreach (string key in sortable.Keys)
|
foreach (string key in sortable.Keys)
|
||||||
{
|
{
|
||||||
List<Rom> roms = sortable[key];
|
List<Rom> roms = sortable[key];
|
||||||
RomTools.Sort(roms, true);
|
RomTools.Sort(ref roms, true);
|
||||||
|
|
||||||
long gameid = -1;
|
long gameid = -1;
|
||||||
using (SqliteConnection dbc = new SqliteConnection(_connectionString))
|
using (SqliteConnection dbc = new SqliteConnection(_connectionString))
|
||||||
|
|||||||
@@ -1779,9 +1779,12 @@ namespace SabreTools.Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now go through and sort all of the lists
|
// Now go through and sort all of the lists
|
||||||
foreach (string key in sortable.Keys)
|
List<string> keys = sortable.Keys.ToList();
|
||||||
|
foreach (string key in keys)
|
||||||
{
|
{
|
||||||
RomTools.Sort(sortable[key], norename);
|
List<Rom> sortedlist = sortable[key];
|
||||||
|
RomTools.Sort(ref sortedlist, norename);
|
||||||
|
sortable[key] = sortedlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output the count if told to
|
// Output the count if told to
|
||||||
@@ -1856,9 +1859,12 @@ namespace SabreTools.Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now go through and sort all of the lists
|
// Now go through and sort all of the lists
|
||||||
foreach (string key in sortable.Keys)
|
List<string> keys = sortable.Keys.ToList();
|
||||||
|
foreach (string key in keys)
|
||||||
{
|
{
|
||||||
RomTools.Sort(sortable[key], norename);
|
List<Rom> sortedlist = sortable[key];
|
||||||
|
RomTools.Sort(ref sortedlist, norename);
|
||||||
|
sortable[key] = sortedlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output the count if told to
|
// Output the count if told to
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ namespace SabreTools.Helper
|
|||||||
/// <param name="roms">List of RomData objects representing the roms to be sorted</param>
|
/// <param name="roms">List of RomData objects representing the roms to be sorted</param>
|
||||||
/// <param name="norename">True if files are not renamed, false otherwise</param>
|
/// <param name="norename">True if files are not renamed, false otherwise</param>
|
||||||
/// <returns>True if it sorted correctly, false otherwise</returns>
|
/// <returns>True if it sorted correctly, false otherwise</returns>
|
||||||
public static bool Sort(List<Rom> roms, bool norename)
|
public static bool Sort(ref List<Rom> roms, bool norename)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user