From 3a77bba3affe1f36c581b630f129a355c5797c8f Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 14 Nov 2026 08:01:01 +0100 Subject: [PATCH] Sync with site code changes --- SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs | 8 ++++++++ .../Data/SubmissionInfoTests.cs | 2 ++ SabreTools.RedumpLib.Test/Tools/FormatterTests.cs | 12 ++++++++---- SabreTools.RedumpLib/Data/DiscResponse.cs | 6 ++++++ .../Data/Sections/DiscIdentifiersSection.cs | 8 ++++++++ SabreTools.RedumpLib/Data/SiteCode.cs | 7 +++++++ SabreTools.RedumpLib/Data/Template.cs | 2 ++ SabreTools.RedumpLib/Tools/Builder.cs | 4 ++++ SabreTools.RedumpLib/Tools/Formatter.cs | 6 ++++++ 9 files changed, 51 insertions(+), 4 deletions(-) diff --git a/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs b/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs index 06505c7..24c456a 100644 --- a/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs +++ b/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs @@ -2500,7 +2500,9 @@ namespace SabreTools.RedumpLib.Test.Data [ SiteCode.PCMacHybrid, SiteCode.PostgapType, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.VCD, +#pragma warning restore CS0618 // Type or member is obsolete ]; /// @@ -2527,7 +2529,9 @@ namespace SabreTools.RedumpLib.Test.Data SiteCode.Genre, SiteCode.HighSierraVolumeDescriptor, SiteCode.InternalName, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.InternalSerialName, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.ISBN, SiteCode.ISSN, SiteCode.Multisession, @@ -2546,9 +2550,13 @@ namespace SabreTools.RedumpLib.Test.Data SiteCode.SSVersion, SiteCode.SteamAppID, SiteCode.TitleID, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.VCD, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.VETSFBID, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.VolumeLabel, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.XeMID, SiteCode.XMID, diff --git a/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs b/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs index c8619b4..337b842 100644 --- a/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs +++ b/SabreTools.RedumpLib.Test/Data/SubmissionInfoTests.cs @@ -55,6 +55,8 @@ namespace SabreTools.RedumpLib.Test.Data Version = "Original", ErrorCount = "0", EXEDate = "19xx-xx-xx", + InternalSerial = "ISN", + VolumeLabel = "CDROM", EDC = YesNo.Yes, Layerbreak = 0, Layerbreak2 = 1, diff --git a/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs b/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs index 36435d8..56b3622 100644 --- a/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs +++ b/SabreTools.RedumpLib.Test/Tools/FormatterTests.cs @@ -51,6 +51,8 @@ namespace SabreTools.RedumpLib.Test.Tools Version = "Original", ErrorCount = "0", EXEDate = "19xx-xx-xx", + InternalSerial = "ISN", + VolumeLabel = "CDROM", EDC = YesNo.Yes, Layerbreak = 0, Layerbreak2 = 1, @@ -227,7 +229,7 @@ namespace SabreTools.RedumpLib.Test.Tools [Fact] public void FormatOutputData_DiscIdentifiersSection_Formatted() { - string expected = "Disc Identifiers:\n\tDisc Serials: XXXXXX\n\tEditions: XXXXXX\n\tBarcodes: XXXXXX\n\tVersion: XXXXXX\n\tError Count: XXXXXX\n\tEXE Date: XXXXXX\n\tEDC: Yes\n\tLayerbreak: 1\n\tLayerbreak 2: 2\n\tLayerbreak 3: 3\n\tDisc ID: XXXXXX\n\tDisc Key: XXXXXX\n\tUniversal Hash: XXXXXX\n"; + string expected = "Disc Identifiers:\n\tDisc Serials: XXXXXX\n\tEditions: XXXXXX\n\tBarcodes: XXXXXX\n\tVersion: XXXXXX\n\tError Count: XXXXXX\n\tEXE Date: XXXXXX\n\tInternal Serial: XXXXXX\n\tVolume Label: XXXXXX\n\tEDC: Yes\n\tLayerbreak: 1\n\tLayerbreak 2: 2\n\tLayerbreak 3: 3\n\tDisc ID: XXXXXX\n\tDisc Key: XXXXXX\n\tUniversal Hash: XXXXXX\n"; var builder = new StringBuilder(); DiscIdentifiersSection? section = new() @@ -238,6 +240,8 @@ namespace SabreTools.RedumpLib.Test.Tools Version = "XXXXXX", ErrorCount = "XXXXXX", EXEDate = "XXXXXX", + InternalSerial = "XXXXXX", + VolumeLabel = "XXXXXX", EDC = YesNo.Yes, Layerbreak = 1, Layerbreak2 = 2, @@ -664,8 +668,8 @@ namespace SabreTools.RedumpLib.Test.Tools [Fact] public void FormatSiteTag_BooleanTrue_Formatted() { - string expected = "[T:VCD]"; - SiteCode code = SiteCode.VCD; + string expected = "PC/Mac Hybrid"; + SiteCode code = SiteCode.PCMacHybrid; string value = "True"; string actual = Formatter.FormatSiteTag(code, value); @@ -675,7 +679,7 @@ namespace SabreTools.RedumpLib.Test.Tools [Fact] public void FormatSiteTag_BooleanFalse_Empty() { - SiteCode code = SiteCode.VCD; + SiteCode code = SiteCode.PCMacHybrid; string value = "XXXXXX"; string actual = Formatter.FormatSiteTag(code, value); diff --git a/SabreTools.RedumpLib/Data/DiscResponse.cs b/SabreTools.RedumpLib/Data/DiscResponse.cs index 4b54d00..19142df 100644 --- a/SabreTools.RedumpLib/Data/DiscResponse.cs +++ b/SabreTools.RedumpLib/Data/DiscResponse.cs @@ -57,6 +57,12 @@ namespace SabreTools.RedumpLib.Data [JsonProperty("exe_date")] public string? ExeDate { get; set; } + [JsonProperty("internal_serial")] + public string? InternalSerial { get; set; } + + [JsonProperty("volume_label")] + public string? VolumeLabel { get; set; } + [JsonProperty("error_count")] public string? ErrorCount { get; set; } diff --git a/SabreTools.RedumpLib/Data/Sections/DiscIdentifiersSection.cs b/SabreTools.RedumpLib/Data/Sections/DiscIdentifiersSection.cs index 11a5ab3..59e965b 100644 --- a/SabreTools.RedumpLib/Data/Sections/DiscIdentifiersSection.cs +++ b/SabreTools.RedumpLib/Data/Sections/DiscIdentifiersSection.cs @@ -28,6 +28,12 @@ namespace SabreTools.RedumpLib.Data.Sections [JsonProperty(PropertyName = "exe_date", NullValueHandling = NullValueHandling.Ignore)] public string? EXEDate { get; set; } + [JsonProperty(PropertyName = "internal_serial", NullValueHandling = NullValueHandling.Ignore)] + public string? InternalSerial { get; set; } + + [JsonProperty(PropertyName = "volume_label", NullValueHandling = NullValueHandling.Ignore)] + public string? VolumeLabel { get; set; } + [JsonProperty(PropertyName = "edc", NullValueHandling = NullValueHandling.Ignore)] [JsonConverter(typeof(YesNoConverter))] public YesNo? EDC { get; set; } @@ -63,6 +69,8 @@ namespace SabreTools.RedumpLib.Data.Sections Version = this.Version, ErrorCount = this.ErrorCount, EXEDate = this.EXEDate, + InternalSerial = this.InternalSerial, + VolumeLabel = this.VolumeLabel, EDC = this.EDC, Layerbreak = this.Layerbreak, Layerbreak2 = this.Layerbreak2, diff --git a/SabreTools.RedumpLib/Data/SiteCode.cs b/SabreTools.RedumpLib/Data/SiteCode.cs index 68e1eab..d80e318 100644 --- a/SabreTools.RedumpLib/Data/SiteCode.cs +++ b/SabreTools.RedumpLib/Data/SiteCode.cs @@ -188,6 +188,7 @@ namespace SabreTools.RedumpLib.Data public static readonly SiteCode InternalName = new("Internal Name:", isCommentCode: true); + [Obsolete("Use SubmissionInfo.DiscIdentifiers.InternalSerial instead")] public static readonly SiteCode InternalSerialName = new("Internal Serial:", code: "[T:ISN]", isCommentCode: true); @@ -362,10 +363,12 @@ namespace SabreTools.RedumpLib.Data isContentCode: true, isMultiLine: true); + [Obsolete("Use SubmissionInfo.DiscIdentifiers.VolumeLabel instead")] public static readonly SiteCode VolumeLabel = new("Volume Label:", code: "[T:VOL]", isCommentCode: true); + [Obsolete("Code is being removed")] public static readonly SiteCode VCD = new("V-CD", code: "[T:VCD]", isBoolean: true, @@ -432,7 +435,9 @@ namespace SabreTools.RedumpLib.Data HighSierraVolumeDescriptor, InternalName, +#pragma warning disable CS0618 // Type or member is obsolete InternalSerialName, +#pragma warning restore CS0618 // Type or member is obsolete InterplayID, ISBN, ISSN, @@ -493,8 +498,10 @@ namespace SabreTools.RedumpLib.Data ValveID, VETSFBID, Videos, +#pragma warning disable CS0618 // Type or member is obsolete VolumeLabel, VCD, +#pragma warning restore CS0618 // Type or member is obsolete XeMID, XMID, diff --git a/SabreTools.RedumpLib/Data/Template.cs b/SabreTools.RedumpLib/Data/Template.cs index a10cc9b..5830523 100644 --- a/SabreTools.RedumpLib/Data/Template.cs +++ b/SabreTools.RedumpLib/Data/Template.cs @@ -41,6 +41,8 @@ public const string VersionField = "Version"; public const string ErrorCountField = "Error Count"; public const string EXEDate = "EXE Date"; + public const string InternalSerialField = "Internal Serial"; + public const string VolumeLabelField = "Volume Label"; public const string EDCField = "EDC"; public const string LayerbreakField = "Layerbreak"; public const string DiscIDField = "Disc ID"; diff --git a/SabreTools.RedumpLib/Tools/Builder.cs b/SabreTools.RedumpLib/Tools/Builder.cs index f83720b..f9b4b92 100644 --- a/SabreTools.RedumpLib/Tools/Builder.cs +++ b/SabreTools.RedumpLib/Tools/Builder.cs @@ -505,12 +505,16 @@ namespace SabreTools.RedumpLib.Tools // Multiple if (siteCode == SiteCode.HighSierraVolumeDescriptor) return true; +#pragma warning disable CS0618 // Type or member is obsolete else if (siteCode == SiteCode.InternalSerialName) return true; +#pragma warning restore CS0618 // Type or member is obsolete else if (siteCode == SiteCode.Multisession) return true; +#pragma warning disable CS0618 // Type or member is obsolete else if (siteCode == SiteCode.VolumeLabel) return true; +#pragma warning restore CS0618 // Type or member is obsolete // Audio CD if (siteCode == SiteCode.RingPerfectAudioOffset) diff --git a/SabreTools.RedumpLib/Tools/Formatter.cs b/SabreTools.RedumpLib/Tools/Formatter.cs index 0602795..aa8fa1c 100644 --- a/SabreTools.RedumpLib/Tools/Formatter.cs +++ b/SabreTools.RedumpLib/Tools/Formatter.cs @@ -22,8 +22,10 @@ namespace SabreTools.RedumpLib.Tools #pragma warning restore CS0618 // Type or member is obsolete SiteCode.EditionNonLatin, SiteCode.InternalName, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.InternalSerialName, SiteCode.VolumeLabel, +#pragma warning restore CS0618 // Type or member is obsolete SiteCode.HighSierraVolumeDescriptor, SiteCode.Multisession, SiteCode.RingPerfectAudioOffset, @@ -59,7 +61,9 @@ namespace SabreTools.RedumpLib.Tools SiteCode.Genre, SiteCode.Series, SiteCode.PostgapType, +#pragma warning disable CS0618 // Type or member is obsolete SiteCode.VCD, +#pragma warning restore CS0618 // Type or member is obsolete // Publisher / Company IDs SiteCode.TwoKGamesID, @@ -311,6 +315,8 @@ namespace SabreTools.RedumpLib.Tools AddIfExists(output, Template.VersionField, section.Version, 1); AddIfExists(output, Template.ErrorCountField, section.ErrorCount, 1); AddIfExists(output, Template.EXEDate, section.EXEDate, 1); + AddIfExists(output, Template.InternalSerialField, section.InternalSerial, 1); + AddIfExists(output, Template.VolumeLabelField, section.VolumeLabel, 1); if (section.EDC is not null && section.EDC != YesNo.NULL) AddIfExists(output, Template.EDCField, section.EDC.LongName(), 1); AddIfExists(output, Template.LayerbreakField, section.Layerbreak, 1);