diff --git a/SabreTools.Library/DatFiles/ClrMamePro.cs b/SabreTools.Library/DatFiles/ClrMamePro.cs index 9f645b15..16ee9968 100644 --- a/SabreTools.Library/DatFiles/ClrMamePro.cs +++ b/SabreTools.Library/DatFiles/ClrMamePro.cs @@ -896,6 +896,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + switch (rom.Type) { case ItemType.Archive: diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index 9321a27c..10850f7d 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -5962,6 +5962,8 @@ namespace SabreTools.Library.DatFiles .Replace("%sha512%", sha512) .Replace("%size%", size); + // TODO: Add GameName logic here too? + return fix; } diff --git a/SabreTools.Library/DatFiles/DosCenter.cs b/SabreTools.Library/DatFiles/DosCenter.cs index d98a9b85..f7503965 100644 --- a/SabreTools.Library/DatFiles/DosCenter.cs +++ b/SabreTools.Library/DatFiles/DosCenter.cs @@ -269,6 +269,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + switch (rom.Type) { case ItemType.Archive: diff --git a/SabreTools.Library/DatFiles/Hashfile.cs b/SabreTools.Library/DatFiles/Hashfile.cs index 4a238c5a..62bd6bd8 100644 --- a/SabreTools.Library/DatFiles/Hashfile.cs +++ b/SabreTools.Library/DatFiles/Hashfile.cs @@ -199,6 +199,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + switch (_hash) { case Hash.MD5: diff --git a/SabreTools.Library/DatFiles/Listrom.cs b/SabreTools.Library/DatFiles/Listrom.cs index 390f7d6c..e4e2a2a8 100644 --- a/SabreTools.Library/DatFiles/Listrom.cs +++ b/SabreTools.Library/DatFiles/Listrom.cs @@ -408,6 +408,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + switch (rom.Type) { case ItemType.Archive: diff --git a/SabreTools.Library/DatFiles/Listxml.cs b/SabreTools.Library/DatFiles/Listxml.cs index fad04d2e..35193d17 100644 --- a/SabreTools.Library/DatFiles/Listxml.cs +++ b/SabreTools.Library/DatFiles/Listxml.cs @@ -781,6 +781,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + switch (rom.Type) { case ItemType.Archive: diff --git a/SabreTools.Library/DatFiles/Logiqx.cs b/SabreTools.Library/DatFiles/Logiqx.cs index 99c27a2c..5c4d1cb0 100644 --- a/SabreTools.Library/DatFiles/Logiqx.cs +++ b/SabreTools.Library/DatFiles/Logiqx.cs @@ -890,6 +890,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + switch (rom.Type) { case ItemType.Archive: diff --git a/SabreTools.Library/DatFiles/Missfile.cs b/SabreTools.Library/DatFiles/Missfile.cs index c9820536..c9765f00 100644 --- a/SabreTools.Library/DatFiles/Missfile.cs +++ b/SabreTools.Library/DatFiles/Missfile.cs @@ -155,6 +155,7 @@ namespace SabreTools.Library.DatFiles try { string state = "", name = "", pre = "", post = ""; + pre = CreatePrefixPostfix(rom, true); post = CreatePrefixPostfix(rom, false); diff --git a/SabreTools.Library/DatFiles/OfflineList.cs b/SabreTools.Library/DatFiles/OfflineList.cs index 0b997605..1a98f3cd 100644 --- a/SabreTools.Library/DatFiles/OfflineList.cs +++ b/SabreTools.Library/DatFiles/OfflineList.cs @@ -954,6 +954,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + state += "\t\t\n" + "\t\t\t1\n" + "\t\t\t1\n" diff --git a/SabreTools.Library/DatFiles/RomCenter.cs b/SabreTools.Library/DatFiles/RomCenter.cs index a0fba298..f19d169d 100644 --- a/SabreTools.Library/DatFiles/RomCenter.cs +++ b/SabreTools.Library/DatFiles/RomCenter.cs @@ -339,6 +339,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + if (rom.Type == ItemType.Rom) { state += "¬" + (String.IsNullOrWhiteSpace(rom.CloneOf) ? "" : HttpUtility.HtmlEncode(rom.CloneOf)) + diff --git a/SabreTools.Library/DatFiles/SabreDat.cs b/SabreTools.Library/DatFiles/SabreDat.cs index 64e6551d..c9a38c9d 100644 --- a/SabreTools.Library/DatFiles/SabreDat.cs +++ b/SabreTools.Library/DatFiles/SabreDat.cs @@ -829,6 +829,11 @@ namespace SabreTools.Library.DatFiles try { string state = "", prefix = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + for (int i = 0; i < depth; i++) { prefix += "\t"; diff --git a/SabreTools.Library/DatFiles/SoftwareList.cs b/SabreTools.Library/DatFiles/SoftwareList.cs index 51148402..fe6ffeac 100644 --- a/SabreTools.Library/DatFiles/SoftwareList.cs +++ b/SabreTools.Library/DatFiles/SoftwareList.cs @@ -785,6 +785,11 @@ namespace SabreTools.Library.DatFiles try { string state = ""; + + // Pre-process the item name + rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false); + rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here + state += "\t\t\n"; foreach (Tuple kvp in rom.Features) diff --git a/SabreTools.Library/README.1ST b/SabreTools.Library/README.1ST index 7b6ec5e6..9a3833b3 100644 --- a/SabreTools.Library/README.1ST +++ b/SabreTools.Library/README.1ST @@ -707,15 +707,15 @@ Options: -pre, --prefix Set prefix for all lines Set a generic prefix to be prepended to all outputted lines. - [*SV, Missfile only] -post, --postfix Set postfix for all lines Set a generic postfix to be appended to all outputted lines. - [*SV, Missfile only] Some special strings that can be used for both prefix and postfix: - - %game% - Replaced with the Game/Machine name + - %game% / %machine% - Replaced with the Game/Machine name - %name% - Replaced with the Rom name + - %%manufacturer%% - Replaced with game Manufacturer + - %publisher% - Replaced with game Publisher - %crc% - Replaced with the CRC - %md5% - Replaced with the MD5 - %sha1% - Replaced with the SHA-1 @@ -726,7 +726,7 @@ Options: -q, --quotes Double-quote each item This flag surrounds the item by double-quotes, not including the - prefix or postfix. [*SV, Missfile only] + prefix or postfix. -r, --roms Output roms to miss instead of sets By default, the outputted file will include the name of the game @@ -735,7 +735,7 @@ Options: -gp, --game-prefix Add game name as a prefix This flag allows for the name of the game to be used as a prefix - to each file. [Missfile, MD5, SFV, SHA* only] + to each file. -ae, --add-extension Add an extension to each item Add a postfix extension to each full item name. [Missfile only] diff --git a/SabreTools/SabreTools.Help.cs b/SabreTools/SabreTools.Help.cs index 46908f8a..9e19785a 100644 --- a/SabreTools/SabreTools.Help.cs +++ b/SabreTools/SabreTools.Help.cs @@ -390,7 +390,7 @@ namespace SabreTools new List() { "-gp", "--game-prefix" }, "Add game name as a prefix", FeatureType.Flag, - longDescription: "This flag allows for the name of the game to be used as a prefix to each file. [Missfile, MD5, SFV, SHA* only]"); + longDescription: "This flag allows for the name of the game to be used as a prefix to each file."); } } private static Feature hashFlag @@ -846,7 +846,7 @@ namespace SabreTools new List() { "-q", "--quotes" }, "Double-quote each item", FeatureType.Flag, - longDescription: "This flag surrounds the item by double-quotes, not including the prefix or postfix. [*SV, Missfile only]"); + longDescription: "This flag surrounds the item by double-quotes, not including the prefix or postfix."); } } private static Feature removeExtensionsFlag @@ -2097,11 +2097,13 @@ Possible values are: None, Zip, Unzip"); new List() { "-post", "--postfix" }, "Set postfix for all lines", FeatureType.String, - longDescription: @"Set a generic postfix to be appended to all outputted lines. [*SV, Missfile only] + longDescription: @"Set a generic postfix to be appended to all outputted lines. Some special strings that can be used: -- %game% - Replaced with the Game/Machine name +- %game% / %machine% - Replaced with the Game/Machine name - %name% - Replaced with the Rom name +- %%manufacturer%% - Replaced with game Manufacturer +- %publisher% - Replaced with game Publisher - %crc% - Replaced with the CRC - %md5% - Replaced with the MD5 - %sha1% - Replaced with the SHA-1 @@ -2120,11 +2122,13 @@ Some special strings that can be used: new List() { "-pre", "--prefix" }, "Set prefix for all lines", FeatureType.String, - longDescription: @"Set a generic prefix to be prepended to all outputted lines. [*SV, Missfile only] + longDescription: @"Set a generic prefix to be prepended to all outputted lines. Some special strings that can be used: -- %game% - Replaced with the Game/Machine name +- %game% / %machine% - Replaced with the Game/Machine name - %name% - Replaced with the Rom name +- %%manufacturer%% - Replaced with game Manufacturer +- %publisher% - Replaced with game Publisher - %crc% - Replaced with the CRC - %md5% - Replaced with the MD5 - %sha1% - Replaced with the SHA-1