mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ExtSplit] Add more logic for multi-extension split
This commit is contained in:
@@ -72,9 +72,9 @@ namespace SabreTools
|
||||
OutputFormat outputFormat = RomManipulation.GetOutputFormat(_filename);
|
||||
DatData datdataA = new DatData
|
||||
{
|
||||
FileName = datdata.FileName + "." + _extA,
|
||||
Name = datdata.Name + "." + _extA,
|
||||
Description = datdata.Description + "." + _extA,
|
||||
FileName = datdata.FileName + " (" + String.Join(",", _extA) + ")",
|
||||
Name = datdata.Name + " (" + String.Join(",", _extA) + ")",
|
||||
Description = datdata.Description + " (" + String.Join(",", _extA) + ")",
|
||||
Category = datdata.Category,
|
||||
Version = datdata.Version,
|
||||
Date = datdata.Date,
|
||||
@@ -88,9 +88,9 @@ namespace SabreTools
|
||||
};
|
||||
DatData datdataB = new DatData
|
||||
{
|
||||
FileName = datdata.FileName + "." + _extB,
|
||||
Name = datdata.Name + "." + _extB,
|
||||
Description = datdata.Description + "." + _extB,
|
||||
FileName = datdata.FileName + " (" + String.Join(",", _extB) + ")",
|
||||
Name = datdata.Name + " (" + String.Join(",", _extB) + ")",
|
||||
Description = datdata.Description + " (" + String.Join(",", _extB) + ")",
|
||||
Category = datdata.Category,
|
||||
Version = datdata.Version,
|
||||
Date = datdata.Date,
|
||||
@@ -114,7 +114,7 @@ namespace SabreTools
|
||||
{
|
||||
foreach (RomData rom in datdata.Roms[key])
|
||||
{
|
||||
if (rom.Name.ToUpperInvariant().EndsWith(_extA[0]))
|
||||
if (_extA.Contains(Path.GetExtension(rom.Name.ToUpperInvariant())))
|
||||
{
|
||||
if (datdataA.Roms.ContainsKey(key))
|
||||
{
|
||||
@@ -127,7 +127,7 @@ namespace SabreTools
|
||||
datdataA.Roms.Add(key, temp);
|
||||
}
|
||||
}
|
||||
else if (rom.Name.ToUpperInvariant().EndsWith(_extB[0]))
|
||||
else if (_extB.Contains(Path.GetExtension(rom.Name.ToUpperInvariant())))
|
||||
{
|
||||
if (datdataB.Roms.ContainsKey(key))
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Mono.Data.Sqlite;
|
||||
|
||||
using SabreTools.Helper;
|
||||
@@ -416,10 +417,9 @@ namespace SabreTools
|
||||
extb = extb.Replace("\"", "");
|
||||
outdir = outdir.Replace("\"", "");
|
||||
|
||||
List<string> extaList = new List<string>();
|
||||
extaList.Add(exta);
|
||||
List<string> extbList = new List<string>();
|
||||
extbList.Add(extb);
|
||||
// Convert comma-separated strings to list
|
||||
List<string> extaList = exta.Split(',').ToList();
|
||||
List<string> extbList = extb.Split(',').ToList();
|
||||
|
||||
if (input != "" && File.Exists(input))
|
||||
{
|
||||
|
||||
@@ -82,8 +82,8 @@ Options:
|
||||
-source= Source name (source only)
|
||||
-url= URL (source only)
|
||||
-es, --ext-split Split a DAT by two file extensions
|
||||
-exta= First extension to split by
|
||||
-extb= Second extension to split by
|
||||
-exta= First set of extensions (comma-separated)
|
||||
-extb= Second set of extensions (comma-separated)
|
||||
-out= Output directory
|
||||
-f, --filter Filter DATs by inputted criteria
|
||||
-out=, --out= Output directory
|
||||
|
||||
Reference in New Issue
Block a user