Updated scanner/upsert logic.
This commit is contained in:
@@ -5,8 +5,14 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace JSMR.Infrastructure.Scanning;
|
||||
|
||||
public class JapaneseVoiceWorksScanner(IHtmlLoader loader) : VoiceWorksScanner(loader)
|
||||
public partial class JapaneseVoiceWorksScanner(IHtmlLoader loader) : VoiceWorksScanner(loader)
|
||||
{
|
||||
[GeneratedRegex("(.*?)年(.*?)月(.*)", RegexOptions.IgnoreCase, "en-US")]
|
||||
private static partial Regex EstimatedDateRegex();
|
||||
|
||||
[GeneratedRegex("販売日: (.*?)年(.*?)月(.*)日", RegexOptions.IgnoreCase, "en-US")]
|
||||
private static partial Regex SalesDateRegex();
|
||||
|
||||
protected override ILocale Locale => new JapaneseLocale();
|
||||
|
||||
protected override ISupportedLanguage[] SupportedLanguages =>
|
||||
@@ -24,7 +30,7 @@ public class JapaneseVoiceWorksScanner(IHtmlLoader loader) : VoiceWorksScanner(l
|
||||
if (expectedDate.Contains("販売中") || expectedDate.Contains("発売予定未定"))
|
||||
return null;
|
||||
|
||||
Regex textRegex = new Regex("(.*?)年(.*?)月(.*)", RegexOptions.IgnoreCase);
|
||||
Regex textRegex = EstimatedDateRegex();
|
||||
MatchCollection textMatches = textRegex.Matches(expectedDate);
|
||||
|
||||
if (textMatches.Count == 0 || textMatches[0].Groups.Count < 4)
|
||||
@@ -57,7 +63,7 @@ public class JapaneseVoiceWorksScanner(IHtmlLoader loader) : VoiceWorksScanner(l
|
||||
|
||||
protected override DateOnly? GetSalesDate(string salesDate)
|
||||
{
|
||||
Regex textRegex = new Regex("販売日: (.*?)年(.*?)月(.*)日", RegexOptions.IgnoreCase);
|
||||
Regex textRegex = SalesDateRegex();
|
||||
MatchCollection textMatches = textRegex.Matches(salesDate);
|
||||
|
||||
if (textMatches.Count == 0 || textMatches[0].Groups.Count < 4)
|
||||
|
||||
Reference in New Issue
Block a user