[DATFromDir] Romba ignores all empty folders

This commit is contained in:
Matt Nadareski
2016-06-04 23:07:58 -07:00
parent f838a2461b
commit 905f11758a
2 changed files with 40 additions and 35 deletions

View File

@@ -305,7 +305,10 @@ namespace SabreTools
lastparent = ProcessFile(subitem, sw, lastparent); lastparent = ProcessFile(subitem, sw, lastparent);
} }
// If there were no subitems, add a "blank" game to to the set // In romba mode we ignore empty folders completely
if (!_datdata.Romba)
{
// If there were no subitems, add a "blank" game to to the set (if not in Romba mode)
if (!items) if (!items)
{ {
string actualroot = item.Remove(0, basePathBackup.Length); string actualroot = item.Remove(0, basePathBackup.Length);
@@ -336,7 +339,7 @@ namespace SabreTools
} }
} }
// Now scour subdirectories for empties and add those as well // Now scour subdirectories for empties and add those as well (if not in Romba mode)
foreach (string subdir in Directory.EnumerateDirectories(item, "*", SearchOption.AllDirectories)) foreach (string subdir in Directory.EnumerateDirectories(item, "*", SearchOption.AllDirectories))
{ {
if (Directory.EnumerateFiles(subdir, "*", SearchOption.AllDirectories).Count() == 0) if (Directory.EnumerateFiles(subdir, "*", SearchOption.AllDirectories).Count() == 0)
@@ -370,6 +373,7 @@ namespace SabreTools
} }
} }
} }
}
_basePath = basePathBackup; _basePath = basePathBackup;
} }
// If this somehow skips past the original sensors // If this somehow skips past the original sensors

View File

@@ -207,6 +207,7 @@ namespace SabreTools.Helper
rom.Name = gc[i].Replace("\"", ""); rom.Name = gc[i].Replace("\"", "");
break; break;
case "size": case "size":
Int64.TryParse(gc[i].Replace("\"", ""), out rom.Size); Int64.TryParse(gc[i].Replace("\"", ""), out rom.Size);
break; break;
case "crc": case "crc":