diff --git a/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs b/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs index 40a0a0f..a0194cc 100644 --- a/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs +++ b/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs @@ -2412,8 +2412,8 @@ namespace SabreTools.RedumpLib.Test.Data SiteCode.DiscID, #pragma warning disable CS0618 // Type or member is obsolete SiteCode.DiscTitleNonLatin, -#pragma warning restore CS0618 // Type or member is obsolete SiteCode.DMIHash, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.DNASDiscID, SiteCode.EditionNonLatin, SiteCode.Filename, @@ -2426,12 +2426,16 @@ namespace SabreTools.RedumpLib.Test.Data SiteCode.Multisession, SiteCode.PCMacHybrid, SiteCode.PEGIID, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.PFIHash, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.PostgapType, SiteCode.Protection, SiteCode.RingPerfectAudioOffset, SiteCode.Series, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.SSHash, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.SSVersion, SiteCode.SteamAppID, SiteCode.TitleID, diff --git a/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs b/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs index 1f578f1..c8619b4 100644 --- a/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs +++ b/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs @@ -112,6 +112,7 @@ namespace SabreTools.RedumpLib.Test.Data DMI = "DMI", Cuesheet = "Cuesheet", Dat = "Datfile", + ExtrasDat = "Extras Datfile", }, SubmissionControls = new SubmissionControlsSection() diff --git a/SabreTools.RedumpLib.Test/Endpoints/DownloadsTests.cs b/SabreTools.RedumpLib.Test/Endpoints/DownloadsTests.cs index fac37cd..345fdd8 100644 --- a/SabreTools.RedumpLib.Test/Endpoints/DownloadsTests.cs +++ b/SabreTools.RedumpLib.Test/Endpoints/DownloadsTests.cs @@ -24,6 +24,7 @@ namespace SabreTools.RedumpLib.Test.Endpoints [InlineData(PackType.Datfile, "https://redump.info/datfile/ARCH")] [InlineData(PackType.Sbis, "https://redump.info/sbi/ARCH")] [InlineData(PackType.BiosDatfile, "https://redump.info/bios/ARCH")] + [InlineData(PackType.ExtrasDatfile, "https://redump.info/extras/ARCH")] public void BuildUrl_ValidPackType_ValidSystem_Builds(PackType packType, string expected) { var endpoint = new RedumpLib.Endpoints.Downloads diff --git a/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs b/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs index 9a5bce5..36435d8 100644 --- a/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs +++ b/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs @@ -108,6 +108,7 @@ namespace SabreTools.RedumpLib.Test.Tools DMI = "DMI", Cuesheet = "Cuesheet", Dat = "Datfile", + ExtrasDat = "Extras Datfile", }, SubmissionControls = new SubmissionControlsSection() @@ -555,7 +556,7 @@ namespace SabreTools.RedumpLib.Test.Tools [Fact] public void FormatOutputData_DumpMetadataSection_Formatted() { - string expected = "Dump Metadata:\n\tComments: XXXXXX\n\tContents: XXXXXX\n\tProtection: XXXXXX\n\tSector Ranges: XXXXXX\n\tSBI: XXXXXX\n\tPrimary Volume Descriptor (PVD): XXXXXX\n\tHeader: XXXXXX\n\tBurst Cutting Area (BCA): XXXXXX\n\tPermanent Information & Control (PIC): XXXXXX\n\tDMI: XXXXXX\n\tCuesheet: XXXXXX\n\tDat:\n\nXXXXXX\n\n\n"; + string expected = "Dump Metadata:\n\tComments: XXXXXX\n\tContents: XXXXXX\n\tProtection: XXXXXX\n\tSector Ranges: XXXXXX\n\tSBI: XXXXXX\n\tPrimary Volume Descriptor (PVD): XXXXXX\n\tHeader: XXXXXX\n\tBurst Cutting Area (BCA): XXXXXX\n\tPermanent Information & Control (PIC): XXXXXX\n\tDMI: XXXXXX\n\tCuesheet: XXXXXX\n\tDat:\n\nXXXXXX\n\n\n\tExtras Dat:\n\nXXXXXX\n\n\n"; var builder = new StringBuilder(); DumpMetadataSection? section = new() @@ -572,6 +573,7 @@ namespace SabreTools.RedumpLib.Test.Tools DMI = "XXXXXX", Cuesheet = "XXXXXX", Dat = "XXXXXX", + ExtrasDat = "XXXXXX", }; Formatter.FormatOutputData(builder, section); diff --git a/SabreTools.RedumpLib/Data/Enumerations.cs b/SabreTools.RedumpLib/Data/Enumerations.cs index 26cb0b7..4192169 100644 --- a/SabreTools.RedumpLib/Data/Enumerations.cs +++ b/SabreTools.RedumpLib/Data/Enumerations.cs @@ -189,6 +189,9 @@ namespace SabreTools.RedumpLib.Data [HumanReadable(LongName = "BIOS", ShortName = "bios")] BiosDatfile = 4, + + [HumanReadable(LongName = "Extras Datfile", ShortName = "extras")] + ExtrasDatfile = 5, } /// diff --git a/SabreTools.RedumpLib/Data/PhysicalSystem.cs b/SabreTools.RedumpLib/Data/PhysicalSystem.cs index 5d1e2df..13b109a 100644 --- a/SabreTools.RedumpLib/Data/PhysicalSystem.cs +++ b/SabreTools.RedumpLib/Data/PhysicalSystem.cs @@ -50,6 +50,11 @@ namespace SabreTools.RedumpLib.Data /// public readonly bool HasBios; + /// + /// System has an extras pack + /// + public readonly bool HasExtras; + /// /// List of valid media types for the system /// @@ -78,6 +83,7 @@ namespace SabreTools.RedumpLib.Data bool hasDat = false, bool hasSbi = false, bool hasBios = false, + bool hasExtras = false, List? mediaTypes = null) { Name = name; @@ -89,6 +95,7 @@ namespace SabreTools.RedumpLib.Data HasDat = hasDat; HasSbi = hasSbi; HasBios = hasBios; + HasExtras = hasExtras; MediaTypes = mediaTypes ?? [null]; } @@ -235,6 +242,7 @@ namespace SabreTools.RedumpLib.Data hasCues: true, hasDat: true, hasBios: true, + hasExtras: true, mediaTypes: [PhysicalMediaType.XGD, PhysicalMediaType.DVD, PhysicalMediaType.CDROM]); // https://en.wikipedia.org/wiki/Xbox_360 @@ -243,6 +251,7 @@ namespace SabreTools.RedumpLib.Data code: "XBOX360", hasCues: true, hasDat: true, + hasExtras: true, mediaTypes: [PhysicalMediaType.XGD, PhysicalMediaType.DVD, PhysicalMediaType.CDROM]); // https://en.wikipedia.org/wiki/Xbox_One diff --git a/SabreTools.RedumpLib/Data/Sections/DumpMetadataSection.cs b/SabreTools.RedumpLib/Data/Sections/DumpMetadataSection.cs index 50c3034..418b77b 100644 --- a/SabreTools.RedumpLib/Data/Sections/DumpMetadataSection.cs +++ b/SabreTools.RedumpLib/Data/Sections/DumpMetadataSection.cs @@ -59,12 +59,15 @@ namespace SabreTools.RedumpLib.Data.Sections [JsonProperty(PropertyName = "dmi", NullValueHandling = NullValueHandling.Ignore)] public string? DMI { get; set; } - [JsonProperty(PropertyName = "cue", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty(PropertyName = "cuesheet", NullValueHandling = NullValueHandling.Ignore)] public string? Cuesheet { get; set; } - [JsonProperty(PropertyName = "files_xml", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty(PropertyName = "dat", NullValueHandling = NullValueHandling.Ignore)] public string? Dat { get; set; } + [JsonProperty(PropertyName = "extras", NullValueHandling = NullValueHandling.Ignore)] + public string? ExtrasDat { get; set; } + /// public object Clone() { @@ -108,6 +111,7 @@ namespace SabreTools.RedumpLib.Data.Sections DMI = this.DMI, Cuesheet = this.Cuesheet, Dat = this.Dat, + ExtrasDat = this.ExtrasDat, }; } } diff --git a/SabreTools.RedumpLib/Data/SiteCode.cs b/SabreTools.RedumpLib/Data/SiteCode.cs index cca121f..68e1eab 100644 --- a/SabreTools.RedumpLib/Data/SiteCode.cs +++ b/SabreTools.RedumpLib/Data/SiteCode.cs @@ -127,6 +127,7 @@ namespace SabreTools.RedumpLib.Data public static readonly SiteCode DisneyInteractiveID = new("Disney Interactive ID:", isCommentCode: true); + [Obsolete("Use SubmissionInfo.DumpMetadata.ExtrasDat instead")] public static readonly SiteCode DMIHash = new("DMI:", isCommentCode: true); @@ -262,6 +263,7 @@ namespace SabreTools.RedumpLib.Data public static readonly SiteCode PEGIID = new("PEGI ID:", isCommentCode: true); + [Obsolete("Use SubmissionInfo.DumpMetadata.ExtrasDat instead")] public static readonly SiteCode PFIHash = new("PFI:", isCommentCode: true); @@ -311,6 +313,7 @@ namespace SabreTools.RedumpLib.Data public static readonly SiteCode SierraID = new("Sierra ID:", isCommentCode: true); + [Obsolete("Use SubmissionInfo.DumpMetadata.ExtrasDat instead")] public static readonly SiteCode SSHash = new("SS:", isCommentCode: true); @@ -406,7 +409,9 @@ namespace SabreTools.RedumpLib.Data DiscTitleNonLatin, #pragma warning restore CS0618 // Type or member is obsolete DisneyInteractiveID, +#pragma warning disable CS0618 // Type or member is obsolete DMIHash, +#pragma warning restore CS0618 // Type or member is obsolete DNASDiscID, EditionNonLatin, @@ -454,7 +459,9 @@ namespace SabreTools.RedumpLib.Data Patches, PCMacHybrid, PEGIID, +#pragma warning disable CS0618 // Type or member is obsolete PFIHash, +#pragma warning restore CS0618 // Type or member is obsolete PlayableDemos, PonyCanyonID, PostgapType, @@ -468,7 +475,9 @@ namespace SabreTools.RedumpLib.Data SelenID, Series, SierraID, +#pragma warning disable CS0618 // Type or member is obsolete SSHash, +#pragma warning restore CS0618 // Type or member is obsolete SSVersion, SteamAppID, SteamCsmCsdDepotID, diff --git a/SabreTools.RedumpLib/Data/Template.cs b/SabreTools.RedumpLib/Data/Template.cs index af22683..a10cc9b 100644 --- a/SabreTools.RedumpLib/Data/Template.cs +++ b/SabreTools.RedumpLib/Data/Template.cs @@ -75,6 +75,7 @@ public const string DMIField = "DMI"; public const string CuesheetField = "Cuesheet"; public const string DatField = "Dat"; + public const string ExtrasDatField = "Extras Dat"; #endregion diff --git a/SabreTools.RedumpLib/Endpoints/Downloads.cs b/SabreTools.RedumpLib/Endpoints/Downloads.cs index 4a1f2e0..261a4b2 100644 --- a/SabreTools.RedumpLib/Endpoints/Downloads.cs +++ b/SabreTools.RedumpLib/Endpoints/Downloads.cs @@ -31,20 +31,17 @@ namespace SabreTools.RedumpLib.Endpoints Host = "redump.info", }; - // HACK: Make copies of the pack and system - var pack = Pack; - var system = System; - - string systemName = system?.Code ?? string.Empty; - switch (pack) + string systemName = System?.Code ?? string.Empty; + switch (Pack) { case PackType.Cuesheets: ub.Path = $"cues/{systemName}"; break; case PackType.Datfile: ub.Path = $"datfile/{systemName}"; break; case PackType.Sbis: ub.Path = $"sbi/{systemName}"; break; case PackType.BiosDatfile: ub.Path = $"bios/{systemName}"; break; + case PackType.ExtrasDatfile: ub.Path = $"extras/{systemName}"; break; // Invalid - default: throw new ArgumentOutOfRangeException(nameof(pack)); + default: throw new ArgumentOutOfRangeException(nameof(Pack)); } return ub.ToString(); diff --git a/SabreTools.RedumpLib/Tools/Builder.cs b/SabreTools.RedumpLib/Tools/Builder.cs index 5d8bf21..268a1b8 100644 --- a/SabreTools.RedumpLib/Tools/Builder.cs +++ b/SabreTools.RedumpLib/Tools/Builder.cs @@ -516,12 +516,14 @@ namespace SabreTools.RedumpLib.Tools return true; // Microsoft Xbox and Xbox 360 +#pragma warning disable CS0618 // Type or member is obsolete if (siteCode == SiteCode.DMIHash) return true; else if (siteCode == SiteCode.PFIHash) return true; else if (siteCode == SiteCode.SSHash) return true; +#pragma warning restore CS0618 // Type or member is obsolete else if (siteCode == SiteCode.SSVersion) return true; else if (siteCode == SiteCode.XMID) @@ -570,17 +572,21 @@ namespace SabreTools.RedumpLib.Tools // For some outdated tags, we need to use alternate names text = text.Replace("Demos:", SiteCode.PlayableDemos.Code); text = text.Replace("Disney ID:", SiteCode.DisneyInteractiveID.HTML); - text = text.Replace("DMI:", SiteCode.DMIHash.HTML); text = text.Replace("LucasArts ID:", SiteCode.LucasArtsID.Code); + text = text.Replace("SS version:", SiteCode.SSVersion.HTML); + text = text.Replace("XeMID:", SiteCode.XeMID.HTML); + text = text.Replace("XMID:", SiteCode.XMID.HTML); + + // These tags are obsolete +#pragma warning disable CS0618 // Type or member is obsolete + text = text.Replace("DMI:", SiteCode.DMIHash.HTML); text = text.Replace("PFI:", SiteCode.PFIHash.HTML); text = text.Replace("SS:", SiteCode.SSHash.HTML); text = text.Replace("SSv1:", SiteCode.SSHash.HTML); text = text.Replace("SSv1:", SiteCode.SSHash.HTML); text = text.Replace("SSv2:", SiteCode.SSHash.HTML); text = text.Replace("SSv2:", SiteCode.SSHash.HTML); - text = text.Replace("SS version:", SiteCode.SSVersion.HTML); - text = text.Replace("XeMID:", SiteCode.XeMID.HTML); - text = text.Replace("XMID:", SiteCode.XMID.HTML); +#pragma warning restore CS0618 // Type or member is obsolete return text; } diff --git a/SabreTools.RedumpLib/Tools/Formatter.cs b/SabreTools.RedumpLib/Tools/Formatter.cs index bc277d0..0602795 100644 --- a/SabreTools.RedumpLib/Tools/Formatter.cs +++ b/SabreTools.RedumpLib/Tools/Formatter.cs @@ -30,9 +30,11 @@ namespace SabreTools.RedumpLib.Tools SiteCode.XMID, SiteCode.XeMID, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.DMIHash, SiteCode.PFIHash, SiteCode.SSHash, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.SSVersion, SiteCode.Filename, @@ -427,6 +429,7 @@ namespace SabreTools.RedumpLib.Tools AddIfExists(output, Template.DMIField, section.DMI, 1); AddIfExists(output, Template.CuesheetField, section.Cuesheet, 1); AddIfExists(output, Template.DatField, section.Dat + "\n", 1); + AddIfExists(output, Template.ExtrasDatField, section.ExtrasDat + "\n", 1); } /// diff --git a/SabreTools.RedumpLib/Web/Client.cs b/SabreTools.RedumpLib/Web/Client.cs index 8ccf188..c0aed92 100644 --- a/SabreTools.RedumpLib/Web/Client.cs +++ b/SabreTools.RedumpLib/Web/Client.cs @@ -1537,6 +1537,7 @@ namespace SabreTools.RedumpLib.Web PackType.Datfile => system.HasDat, PackType.Sbis => system.HasSbi, PackType.BiosDatfile => system.HasBios, + PackType.ExtrasDatfile => system.HasExtras, _ => false, }; } diff --git a/SabreTools.RedumpLib/Web/Packs.cs b/SabreTools.RedumpLib/Web/Packs.cs index e2976ef..a64e0fd 100644 --- a/SabreTools.RedumpLib/Web/Packs.cs +++ b/SabreTools.RedumpLib/Web/Packs.cs @@ -68,6 +68,7 @@ namespace SabreTools.RedumpLib.Web _ = await client.DownloadPacks(PackType.Datfile, systems, outDir, useSubfolders ? "dat" : null); _ = await client.DownloadPacks(PackType.Sbis, systems, outDir, useSubfolders ? "sbi" : null); _ = await client.DownloadPacks(PackType.BiosDatfile, systems, outDir, useSubfolders ? "bios" : null); + _ = await client.DownloadPacks(PackType.ExtrasDatfile, systems, outDir, useSubfolders ? "extras" : null); if (includeDatabase) _ = await client.DownloadDatabase(outDir, useSubfolders ? "db" : null);