diff --git a/RedumpTool/Features/QueryFeature.cs b/RedumpTool/Features/QueryFeature.cs
index dbaac3c..3b83f7e 100644
--- a/RedumpTool/Features/QueryFeature.cs
+++ b/RedumpTool/Features/QueryFeature.cs
@@ -4,7 +4,6 @@ using System.Threading.Tasks;
using SabreTools.CommandLine.Inputs;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.RedumpOrg;
-using SabreTools.RedumpLib.RedumpOrg.Data;
namespace RedumpTool.Features
{
diff --git a/RedumpTool/Features/SiteFeature.cs b/RedumpTool/Features/SiteFeature.cs
index 99d85b0..cb3b456 100644
--- a/RedumpTool/Features/SiteFeature.cs
+++ b/RedumpTool/Features/SiteFeature.cs
@@ -4,7 +4,6 @@ using System.Threading.Tasks;
using SabreTools.CommandLine.Inputs;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.RedumpOrg;
-using SabreTools.RedumpLib.RedumpOrg.Data;
namespace RedumpTool.Features
{
diff --git a/RedumpTool/Features/UserFeature.cs b/RedumpTool/Features/UserFeature.cs
index e6c22cd..dce2ebf 100644
--- a/RedumpTool/Features/UserFeature.cs
+++ b/RedumpTool/Features/UserFeature.cs
@@ -4,7 +4,6 @@ using System.Threading.Tasks;
using SabreTools.CommandLine.Inputs;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.RedumpOrg;
-using SabreTools.RedumpLib.RedumpOrg.Data;
namespace RedumpTool.Features
{
diff --git a/SabreTools.RedumpLib.Test/ValidatorTests.cs b/SabreTools.RedumpLib.Test/ValidatorTests.cs
index d6d1933..dc14afd 100644
--- a/SabreTools.RedumpLib.Test/ValidatorTests.cs
+++ b/SabreTools.RedumpLib.Test/ValidatorTests.cs
@@ -1,6 +1,5 @@
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.Data.Sections;
-using SabreTools.RedumpLib.RedumpOrg.Data;
using Xunit;
namespace SabreTools.RedumpLib.Test
diff --git a/SabreTools.RedumpLib/Builder.cs b/SabreTools.RedumpLib/Builder.cs
index dc7398d..abb532e 100644
--- a/SabreTools.RedumpLib/Builder.cs
+++ b/SabreTools.RedumpLib/Builder.cs
@@ -12,7 +12,6 @@ using Newtonsoft.Json;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.Data.Sections;
using SabreTools.RedumpLib.RedumpOrg;
-using SabreTools.RedumpLib.RedumpOrg.Data;
namespace SabreTools.RedumpLib
{
diff --git a/SabreTools.RedumpLib/RedumpInfo/Client.cs b/SabreTools.RedumpLib/RedumpInfo/Client.cs
index de70481..f617a80 100644
--- a/SabreTools.RedumpLib/RedumpInfo/Client.cs
+++ b/SabreTools.RedumpLib/RedumpInfo/Client.cs
@@ -90,16 +90,6 @@ namespace SabreTools.RedumpLib.RedumpInfo
#region Constants
- ///
- /// Regex matching the current creation time for login
- ///
- public static readonly Regex LoginCreationTimeRegex = new(@"", RegexOptions.Compiled);
-
- ///
- /// Regex matching the current nonce token for login
- ///
- public static readonly Regex LoginTokenRegex = new(@"", RegexOptions.Compiled);
-
///
/// Login page URL
///
@@ -186,8 +176,8 @@ namespace SabreTools.RedumpLib.RedumpInfo
// Get the current token from the login page
var loginPage = await DownloadString(LoginUrl);
- string creationTime = LoginCreationTimeRegex.Match(loginPage ?? string.Empty).Groups[1].Value;
- string token = LoginTokenRegex.Match(loginPage ?? string.Empty).Groups[1].Value;
+ string creationTime = Constants.LoginCreationTimeRegex.Match(loginPage ?? string.Empty).Groups[1].Value;
+ string token = Constants.LoginTokenRegex.Match(loginPage ?? string.Empty).Groups[1].Value;
#if NETCOREAPP
// Construct the login request
@@ -459,7 +449,7 @@ namespace SabreTools.RedumpLib.RedumpInfo
if (dumpsPage.Contains("Download:"))
{
if (Debug) Console.WriteLine($"DEBUG: CheckSingleSitePage(\"{url}\") - Single disc page");
- var value = RedumpOrg.Data.Constants.SfvRegex.Match(dumpsPage).Groups[1].Value;
+ var value = Constants.SfvRegex.Match(dumpsPage).Groups[1].Value;
if (int.TryParse(value, out int id))
ids.Add(id);
@@ -467,7 +457,7 @@ namespace SabreTools.RedumpLib.RedumpInfo
}
// Otherwise, traverse each dump on the page
- var matches = RedumpOrg.Data.Constants.DiscRegex.Matches(dumpsPage);
+ var matches = Constants.DiscRegex.Matches(dumpsPage);
foreach (Match? match in matches)
{
if (match is null)
@@ -594,7 +584,7 @@ namespace SabreTools.RedumpLib.RedumpInfo
}
// Otherwise, traverse each dump on the page
- var matches = RedumpOrg.Data.Constants.NewDiscRegex.Matches(dumpsPage);
+ var matches = Constants.NewDiscRegex.Matches(dumpsPage);
foreach (Match? match in matches)
{
if (match is null)
@@ -958,8 +948,8 @@ namespace SabreTools.RedumpLib.RedumpInfo
var oldDiscPage = File.ReadAllText(Path.Combine(paddedIdDir, "disc.html"));
// Check for the last modified date in both pages
- var oldResult = RedumpOrg.Data.Constants.LastModifiedRegex.Match(oldDiscPage);
- var newResult = RedumpOrg.Data.Constants.LastModifiedRegex.Match(discPage);
+ var oldResult = Constants.LastModifiedRegex.Match(oldDiscPage);
+ var newResult = Constants.LastModifiedRegex.Match(discPage);
// If both pages contain the same modified date, skip it
if (oldResult.Success && newResult.Success && oldResult.Groups[1].Value == newResult.Groups[1].Value)
@@ -977,8 +967,8 @@ namespace SabreTools.RedumpLib.RedumpInfo
}
// If the downloaded data is invalid or otherwise empty, skip it
- var hasAddedDate = RedumpOrg.Data.Constants.AddedRegex.Match(discPage);
- var hasModifiedDate = RedumpOrg.Data.Constants.LastModifiedRegex.Match(discPage);
+ var hasAddedDate = Constants.AddedRegex.Match(discPage);
+ var hasModifiedDate = Constants.LastModifiedRegex.Match(discPage);
if (!hasAddedDate.Success && !hasModifiedDate.Success)
{
Console.WriteLine($"ID {paddedId} retieved an empty page, skipping...");
@@ -1164,8 +1154,8 @@ namespace SabreTools.RedumpLib.RedumpInfo
var oldDiscPage = File.ReadAllText(Path.Combine(paddedIdDir, "disc.html"));
// Check for the full match ID in both pages
- var oldResult = RedumpOrg.Data.Constants.FullMatchRegex.Match(oldDiscPage);
- var newResult = RedumpOrg.Data.Constants.FullMatchRegex.Match(discPage);
+ var oldResult = Constants.FullMatchRegex.Match(oldDiscPage);
+ var newResult = Constants.FullMatchRegex.Match(discPage);
// If both pages contain the same ID, skip it
if (oldResult.Success && newResult.Success && oldResult.Groups[1].Value == newResult.Groups[1].Value)
@@ -1182,8 +1172,8 @@ namespace SabreTools.RedumpLib.RedumpInfo
}
// Check the added date as a backup
- oldResult = RedumpOrg.Data.Constants.AddedRegex.Match(oldDiscPage);
- newResult = RedumpOrg.Data.Constants.AddedRegex.Match(discPage);
+ oldResult = Constants.AddedRegex.Match(oldDiscPage);
+ newResult = Constants.AddedRegex.Match(discPage);
// If the downloaded data is invalid or otherwise empty, skip it
if (oldResult.Success && !newResult.Success)
diff --git a/SabreTools.RedumpLib/RedumpInfo/Constants.cs b/SabreTools.RedumpLib/RedumpInfo/Constants.cs
new file mode 100644
index 0000000..09b9319
--- /dev/null
+++ b/SabreTools.RedumpLib/RedumpInfo/Constants.cs
@@ -0,0 +1,217 @@
+using System.Text.RegularExpressions;
+using SabreTools.RedumpLib.Data;
+
+namespace SabreTools.RedumpLib.RedumpInfo
+{
+ public static class Constants
+ {
+ #region Regular Expressions
+
+ ///
+ /// Regex matching the added field on a disc page
+ ///
+ public static readonly Regex AddedRegex = new(@"
Added
(.*?)
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the barcodes field on a disc page
+ ///
+ public static readonly Regex BarcodesRegex = new(@"
Barcodes
(.*?)
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the BCA field on a disc page
+ ///
+ public static readonly Regex BcaRegex = new(@"
BCA
"
+ + @"
"
+ + @"
"
+ + "
Row
Contents
ASCII
"
+ + ""
+ + "
(?.*?)
(?.*?)
(?.*?)
"
+ + "
(?.*?)
(?.*?)
(?.*?)
"
+ + "
(?.*?)
(?.*?)
(?.*?)
"
+ + "
(?.*?)
(?.*?)
(?.*?)
", RegexOptions.Compiled | RegexOptions.Singleline);
+
+ ///
+ /// Regex matching the category field on a disc page
+ ///
+ public static readonly Regex CategoryRegex = new(@"
Category
(.*?)
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the comments field on a disc page
+ ///
+ public static readonly Regex CommentsRegex = new(@"
Comments
(.*?)
", RegexOptions.Compiled | RegexOptions.Singleline);
+
+ ///
+ /// Regex matching the contents field on a disc page
+ ///
+ public static readonly Regex ContentsRegex = new(@"
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the languages field on a disc page
+ ///
+ public static readonly Regex LanguagesRegex = new(@"\s*", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the last modified field on a disc page
+ ///
+ public static readonly Regex LastModifiedRegex = new(@"
Modified
(.*?)
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the current creation time for login
+ ///
+ public static readonly Regex LoginCreationTimeRegex = new(@"", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the current nonce token for login
+ ///
+ public static readonly Regex LoginTokenRegex = new(@"", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the media field on a disc page
+ ///
+ public static readonly Regex MediaRegex = new(@"
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the disc key on a PS3 disc page
+ ///
+ public static readonly Regex PS3DiscKey = new(@"
Disc Key
(.*?)
", RegexOptions.Compiled);
+
+ ///
+ /// Regex matching the PVD field on a disc page
+ ///
+ public static readonly Regex PvdRegex = new("
PVD
"
+ + @"
"
+ + @"
"
+ + "
Contents
Date
Time
GMT
"
+ + ""
+ + "
Creation
(?.*?)
(?.*?)
(?.*?)
(?.*?)
"
+ + "
Modification
(?.*?)
(?.*?)
(?.*?)
(?.*?)
"
+ + "
Expiration
(?.*?)
(?.*?)
(?.*?)
(?.*?)
"
+ + "
Effective
(?.*?)
(?.*?)
(?.*?)
(?.*?)
", RegexOptions.Compiled | RegexOptions.Singleline);
+
+ ///
+ /// Regex matching the region field on a disc page
+ ///
+ public static readonly Regex RegionRegex = new(@"