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);
|
OutputFormat outputFormat = RomManipulation.GetOutputFormat(_filename);
|
||||||
DatData datdataA = new DatData
|
DatData datdataA = new DatData
|
||||||
{
|
{
|
||||||
FileName = datdata.FileName + "." + _extA,
|
FileName = datdata.FileName + " (" + String.Join(",", _extA) + ")",
|
||||||
Name = datdata.Name + "." + _extA,
|
Name = datdata.Name + " (" + String.Join(",", _extA) + ")",
|
||||||
Description = datdata.Description + "." + _extA,
|
Description = datdata.Description + " (" + String.Join(",", _extA) + ")",
|
||||||
Category = datdata.Category,
|
Category = datdata.Category,
|
||||||
Version = datdata.Version,
|
Version = datdata.Version,
|
||||||
Date = datdata.Date,
|
Date = datdata.Date,
|
||||||
@@ -88,9 +88,9 @@ namespace SabreTools
|
|||||||
};
|
};
|
||||||
DatData datdataB = new DatData
|
DatData datdataB = new DatData
|
||||||
{
|
{
|
||||||
FileName = datdata.FileName + "." + _extB,
|
FileName = datdata.FileName + " (" + String.Join(",", _extB) + ")",
|
||||||
Name = datdata.Name + "." + _extB,
|
Name = datdata.Name + " (" + String.Join(",", _extB) + ")",
|
||||||
Description = datdata.Description + "." + _extB,
|
Description = datdata.Description + " (" + String.Join(",", _extB) + ")",
|
||||||
Category = datdata.Category,
|
Category = datdata.Category,
|
||||||
Version = datdata.Version,
|
Version = datdata.Version,
|
||||||
Date = datdata.Date,
|
Date = datdata.Date,
|
||||||
@@ -114,7 +114,7 @@ namespace SabreTools
|
|||||||
{
|
{
|
||||||
foreach (RomData rom in datdata.Roms[key])
|
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))
|
if (datdataA.Roms.ContainsKey(key))
|
||||||
{
|
{
|
||||||
@@ -127,7 +127,7 @@ namespace SabreTools
|
|||||||
datdataA.Roms.Add(key, temp);
|
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))
|
if (datdataB.Roms.ContainsKey(key))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using Mono.Data.Sqlite;
|
using Mono.Data.Sqlite;
|
||||||
|
|
||||||
using SabreTools.Helper;
|
using SabreTools.Helper;
|
||||||
@@ -416,10 +417,9 @@ namespace SabreTools
|
|||||||
extb = extb.Replace("\"", "");
|
extb = extb.Replace("\"", "");
|
||||||
outdir = outdir.Replace("\"", "");
|
outdir = outdir.Replace("\"", "");
|
||||||
|
|
||||||
List<string> extaList = new List<string>();
|
// Convert comma-separated strings to list
|
||||||
extaList.Add(exta);
|
List<string> extaList = exta.Split(',').ToList();
|
||||||
List<string> extbList = new List<string>();
|
List<string> extbList = extb.Split(',').ToList();
|
||||||
extbList.Add(extb);
|
|
||||||
|
|
||||||
if (input != "" && File.Exists(input))
|
if (input != "" && File.Exists(input))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ Options:
|
|||||||
-source= Source name (source only)
|
-source= Source name (source only)
|
||||||
-url= URL (source only)
|
-url= URL (source only)
|
||||||
-es, --ext-split Split a DAT by two file extensions
|
-es, --ext-split Split a DAT by two file extensions
|
||||||
-exta= First extension to split by
|
-exta= First set of extensions (comma-separated)
|
||||||
-extb= Second extension to split by
|
-extb= Second set of extensions (comma-separated)
|
||||||
-out= Output directory
|
-out= Output directory
|
||||||
-f, --filter Filter DATs by inputted criteria
|
-f, --filter Filter DATs by inputted criteria
|
||||||
-out=, --out= Output directory
|
-out=, --out= Output directory
|
||||||
|
|||||||
Reference in New Issue
Block a user