Rename the modified date regex

This commit is contained in:
Matt Nadareski
2026-06-23 12:12:48 -04:00
parent dabf616cba
commit 2b108e56ff
3 changed files with 9 additions and 9 deletions

View File

@@ -74,11 +74,6 @@ namespace SabreTools.RedumpLib.Data
/// </summary>
public static readonly Regex LanguagesRegex = new(@"<img class=""flag-icon"" src=""/static/flags/(.*?)\.svg"" title="".*?"" alt="".*?"" />\s*", RegexOptions.Compiled);
/// <summary>
/// Regex matching the last modified field on a disc page
/// </summary>
public static readonly Regex LastModifiedRegex = new(@"<tr><td><strong>Modified</strong></td><td>(.*?)</td></tr>", RegexOptions.Compiled);
/// <summary>
/// Regex matching the current creation time for login
/// </summary>
@@ -94,6 +89,11 @@ namespace SabreTools.RedumpLib.Data
/// </summary>
public static readonly Regex MediaRegex = new(@"<tr><td><strong>Media</strong></td><td>(.*?)</td></tr>", RegexOptions.Compiled);
/// <summary>
/// Regex matching the last modified field on a disc page
/// </summary>
public static readonly Regex ModifiedRegex = new(@"<tr><td><strong>Modified</strong></td><td>(.*?)</td></tr>", RegexOptions.Compiled);
/// <summary>
/// Regex matching individual WIP disc links on a results page
/// </summary>

View File

@@ -386,7 +386,7 @@ namespace SabreTools.RedumpLib.Tools
}
// Last Modified
match = Constants.LastModifiedRegex.Match(discData);
match = Constants.ModifiedRegex.Match(discData);
if (match.Success)
{
if (DateTime.TryParse(match.Groups[1].Value, out DateTime lastModified))

View File

@@ -1012,8 +1012,8 @@ namespace SabreTools.RedumpLib.Web
var oldDiscPage = File.ReadAllText(Path.Combine(paddedIdDir, "disc.html"));
// Check for the last modified date in both pages
var oldResult = Constants.LastModifiedRegex.Match(oldDiscPage);
var newResult = Constants.LastModifiedRegex.Match(discPage);
var oldResult = Constants.ModifiedRegex.Match(oldDiscPage);
var newResult = Constants.ModifiedRegex.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)
@@ -1032,7 +1032,7 @@ namespace SabreTools.RedumpLib.Web
// If the downloaded data is invalid or otherwise empty, skip it
var hasAddedDate = Constants.AddedRegex.Match(discPage);
var hasModifiedDate = Constants.LastModifiedRegex.Match(discPage);
var hasModifiedDate = Constants.ModifiedRegex.Match(discPage);
if (!hasAddedDate.Success && !hasModifiedDate.Success)
{
Console.WriteLine($"ID {paddedId} retieved an empty page, skipping...");