From 7e6398db1a6e50d4570e3b024d4eecac267cd81d Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 21 Jun 2026 22:42:04 -0400 Subject: [PATCH] Make info constants default --- RedumpTool/Features/QueryFeature.cs | 2 +- RedumpTool/Features/SiteFeature.cs | 2 +- RedumpTool/Features/UserFeature.cs | 2 +- SabreTools.RedumpLib/Builder.cs | 30 +++++++++---------- .../{RedumpInfo => Data}/Constants.cs | 3 +- 5 files changed, 19 insertions(+), 20 deletions(-) rename SabreTools.RedumpLib/{RedumpInfo => Data}/Constants.cs (99%) diff --git a/RedumpTool/Features/QueryFeature.cs b/RedumpTool/Features/QueryFeature.cs index 06ebd73..d8c4e11 100644 --- a/RedumpTool/Features/QueryFeature.cs +++ b/RedumpTool/Features/QueryFeature.cs @@ -95,7 +95,7 @@ namespace RedumpTool.Features } else { - discSubpaths = SabreTools.RedumpLib.RedumpInfo.Constants.AllDiscSubpaths; + discSubpaths = SabreTools.RedumpLib.Data.Constants.AllDiscSubpaths; } // Output directory validation diff --git a/RedumpTool/Features/SiteFeature.cs b/RedumpTool/Features/SiteFeature.cs index 0add534..9003bcc 100644 --- a/RedumpTool/Features/SiteFeature.cs +++ b/RedumpTool/Features/SiteFeature.cs @@ -168,7 +168,7 @@ namespace RedumpTool.Features } else { - discSubpaths = SabreTools.RedumpLib.RedumpInfo.Constants.AllDiscSubpaths; + discSubpaths = SabreTools.RedumpLib.Data.Constants.AllDiscSubpaths; } // Override individual flags if shorthand flags used diff --git a/RedumpTool/Features/UserFeature.cs b/RedumpTool/Features/UserFeature.cs index 67c7970..d917236 100644 --- a/RedumpTool/Features/UserFeature.cs +++ b/RedumpTool/Features/UserFeature.cs @@ -95,7 +95,7 @@ namespace RedumpTool.Features } else { - discSubpaths = SabreTools.RedumpLib.RedumpInfo.Constants.AllDiscSubpaths; + discSubpaths = SabreTools.RedumpLib.Data.Constants.AllDiscSubpaths; } // Output directory validation diff --git a/SabreTools.RedumpLib/Builder.cs b/SabreTools.RedumpLib/Builder.cs index deaf195..a24c8fd 100644 --- a/SabreTools.RedumpLib/Builder.cs +++ b/SabreTools.RedumpLib/Builder.cs @@ -264,7 +264,7 @@ namespace SabreTools.RedumpLib return false; // Title, Disc Number/Letter, Disc Title - var match = RedumpInfo.Constants.TitleRegex.Match(discData); + var match = Constants.TitleRegex.Match(discData); if (match.Success) { string? title = WebUtility.HtmlDecode(match.Groups[1].Value); @@ -278,7 +278,7 @@ namespace SabreTools.RedumpLib #else info.CommonDiscInfo!.Title = title.Substring(0, firstParenLocation); #endif - var submatches = RedumpInfo.Constants.DiscNumberLetterRegex.Matches(title); + var submatches = Constants.DiscNumberLetterRegex.Matches(title); foreach (Match? submatch in submatches) { if (submatch is null) @@ -311,12 +311,12 @@ namespace SabreTools.RedumpLib } // Foreign Title - match = RedumpInfo.Constants.ForeignTitleRegex.Match(discData); + match = Constants.ForeignTitleRegex.Match(discData); if (match.Success) info.CommonDiscInfo!.ForeignTitleNonLatin = WebUtility.HtmlDecode(match.Groups[1].Value); // Category - match = RedumpInfo.Constants.CategoryRegex.Match(discData); + match = Constants.CategoryRegex.Match(discData); if (match.Success) info.CommonDiscInfo!.Category = match.Groups[1].Value.ToDiscCategory(); else @@ -325,13 +325,13 @@ namespace SabreTools.RedumpLib // Region if (info.CommonDiscInfo.Region is null) { - match = RedumpInfo.Constants.RegionRegex.Match(discData); + match = Constants.RegionRegex.Match(discData); if (match.Success) info.CommonDiscInfo.Region = match.Groups[1].Value.ToRegion(); } // Languages - var matches = RedumpInfo.Constants.LanguagesRegex.Matches(discData); + var matches = Constants.LanguagesRegex.Matches(discData); if (matches.Count > 0) { var tempLanguages = new List(); @@ -352,7 +352,7 @@ namespace SabreTools.RedumpLib if (includeAllData) { // TODO: Re-enable if there's a way of verifying against a disc - //match = RedumpInfo.Constants.SerialRegex.Match(discData); + //match = Data.Constants.SerialRegex.Match(discData); //if (match.Success) // info.CommonDiscInfo.Serial = $"(VERIFY THIS) {WebUtility.HtmlDecode(match.Groups[1].Value)}"; } @@ -360,7 +360,7 @@ namespace SabreTools.RedumpLib // Error count if (string.IsNullOrEmpty(info.CommonDiscInfo.ErrorsCount)) { - match = RedumpInfo.Constants.ErrorCountRegex.Match(discData); + match = Constants.ErrorCountRegex.Match(discData); if (match.Success) info.CommonDiscInfo.ErrorsCount = match.Groups[1].Value; } @@ -368,13 +368,13 @@ namespace SabreTools.RedumpLib // Version if (info.VersionAndEditions!.Version is null) { - match = RedumpInfo.Constants.VersionRegex.Match(discData); + match = Constants.VersionRegex.Match(discData); if (match.Success) info.VersionAndEditions.Version = $"(VERIFY THIS) {WebUtility.HtmlDecode(match.Groups[1].Value)}"; } // Dumpers - matches = RedumpInfo.Constants.DumpersRegex.Matches(discData); + matches = Constants.DumpersRegex.Matches(discData); if (matches.Count > 0) { // Start with any currently listed dumpers @@ -402,7 +402,7 @@ namespace SabreTools.RedumpLib if (string.IsNullOrEmpty(info.Extras!.DiscKey)) { // Validate key is not NULL - match = RedumpInfo.Constants.PS3DiscKey.Match(discData); + match = Constants.PS3DiscKey.Match(discData); if (match.Success && match.Groups[1].Value != "NULL") info.Extras.DiscKey = match.Groups[1].Value; } @@ -412,7 +412,7 @@ namespace SabreTools.RedumpLib // Comments if (includeAllData) { - match = RedumpInfo.Constants.CommentsRegex.Match(discData); + match = Constants.CommentsRegex.Match(discData); if (match.Success) { // Process the old comments block @@ -509,7 +509,7 @@ namespace SabreTools.RedumpLib // Contents if (includeAllData) { - match = RedumpInfo.Constants.ContentsRegex.Match(discData); + match = Constants.ContentsRegex.Match(discData); if (match.Success) { // Process the old contents block @@ -595,7 +595,7 @@ namespace SabreTools.RedumpLib } // Added - match = RedumpInfo.Constants.AddedRegex.Match(discData); + match = Constants.AddedRegex.Match(discData); if (match.Success) { if (DateTime.TryParse(match.Groups[1].Value, out DateTime added)) @@ -605,7 +605,7 @@ namespace SabreTools.RedumpLib } // Last Modified - match = RedumpInfo.Constants.LastModifiedRegex.Match(discData); + match = Constants.LastModifiedRegex.Match(discData); if (match.Success) { if (DateTime.TryParse(match.Groups[1].Value, out DateTime lastModified)) diff --git a/SabreTools.RedumpLib/RedumpInfo/Constants.cs b/SabreTools.RedumpLib/Data/Constants.cs similarity index 99% rename from SabreTools.RedumpLib/RedumpInfo/Constants.cs rename to SabreTools.RedumpLib/Data/Constants.cs index 19e49f7..1493096 100644 --- a/SabreTools.RedumpLib/RedumpInfo/Constants.cs +++ b/SabreTools.RedumpLib/Data/Constants.cs @@ -1,7 +1,6 @@ using System.Text.RegularExpressions; -using SabreTools.RedumpLib.Data; -namespace SabreTools.RedumpLib.RedumpInfo +namespace SabreTools.RedumpLib.Data { public static class Constants {