Moved some classes around to the domain layer.
This commit is contained in:
@@ -11,7 +11,7 @@ public class VoiceWorkDetails
|
|||||||
public int WishlistCount { get; init; }
|
public int WishlistCount { get; init; }
|
||||||
public int DownloadCount { get; init; }
|
public int DownloadCount { get; init; }
|
||||||
public DateTime? RegistrationDate { get; init; }
|
public DateTime? RegistrationDate { get; init; }
|
||||||
public SupportedLanguage[] SupportedLanguages { get; init; } = [];
|
public IReadOnlyList<SupportedLanguage> SupportedLanguages { get; init; } = [];
|
||||||
public AIGeneration AI { get; init; }
|
public AIGeneration AI { get; init; }
|
||||||
public bool HasTrial { get; init; }
|
public bool HasTrial { get; init; }
|
||||||
public bool HasDLPlay { get; init; }
|
public bool HasDLPlay { get; init; }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace JSMR.Application.Integrations.DLSite.Models;
|
namespace JSMR.Application.Integrations.DLSite.Models;
|
||||||
|
|
||||||
public class VoiceWorkSeries
|
//public class VoiceWorkSeries
|
||||||
{
|
//{
|
||||||
public required string Identifier { get; init; }
|
// public required string Identifier { get; init; }
|
||||||
public required string Name { get; init; }
|
// public required string Name { get; init; }
|
||||||
}
|
//}
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace JSMR.Application.Integrations.DLSite.Models;
|
namespace JSMR.Application.Integrations.DLSite.Models;
|
||||||
|
|
||||||
public class VoiceWorkTranslation
|
//public class VoiceWorkTranslation
|
||||||
{
|
//{
|
||||||
public required string OriginalProductId { get; init; }
|
// public required string OriginalProductId { get; init; }
|
||||||
public bool IsOfficialTranslation { get; init; }
|
// public bool IsOfficialTranslation { get; init; }
|
||||||
public bool IsRecommendedTranslation { get; init; }
|
// public bool IsRecommendedTranslation { get; init; }
|
||||||
public required Language Language { get; init; }
|
// public required Language Language { get; init; }
|
||||||
}
|
//}
|
||||||
@@ -21,7 +21,7 @@ public sealed record VoiceWorkIngest
|
|||||||
public int? Votes { get; init; }
|
public int? Votes { get; init; }
|
||||||
public AgeRating AgeRating { get; init; }
|
public AgeRating AgeRating { get; init; }
|
||||||
public bool HasImage { get; init; }
|
public bool HasImage { get; init; }
|
||||||
public ICollection<SupportedLanguage> SupportedLanguages { get; init; } = [];
|
public IReadOnlyList<SupportedLanguage> SupportedLanguages { get; init; } = [];
|
||||||
public DateOnly? ExpectedDate { get; init; }
|
public DateOnly? ExpectedDate { get; init; }
|
||||||
public DateOnly? SalesDate { get; init; }
|
public DateOnly? SalesDate { get; init; }
|
||||||
public DateTime? RegistrationDate { get; init; }
|
public DateTime? RegistrationDate { get; init; }
|
||||||
|
|||||||
9
JSMR.Domain/Enums/TranslationKind.cs
Normal file
9
JSMR.Domain/Enums/TranslationKind.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace JSMR.Domain.Enums;
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum TranslationKind
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Official = 1,
|
||||||
|
Recommended = 2
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using JSMR.Domain.Enums;
|
using JSMR.Domain.Enums;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace JSMR.Domain.ValueObjects;
|
namespace JSMR.Domain.ValueObjects;
|
||||||
|
|
||||||
@@ -26,14 +27,14 @@ public sealed record SupportedLanguage(string Code, Language Language)
|
|||||||
private static readonly Dictionary<Language, SupportedLanguage> _byLang =
|
private static readonly Dictionary<Language, SupportedLanguage> _byLang =
|
||||||
All.ToDictionary(x => x.Language);
|
All.ToDictionary(x => x.Language);
|
||||||
|
|
||||||
public static bool TryFromCode(string code, out SupportedLanguage? supportedLanguage) =>
|
public static bool TryFromCode(string code, [MaybeNullWhen(false)] out SupportedLanguage supportedLanguage) =>
|
||||||
_byCode.TryGetValue(code, out supportedLanguage);
|
_byCode.TryGetValue(code, out supportedLanguage);
|
||||||
|
|
||||||
public static bool TryFromLanguage(Language lang, out SupportedLanguage? supportedLanguage) =>
|
public static bool TryFromLanguage(Language language, [MaybeNullWhen(false)] out SupportedLanguage supportedLanguage) =>
|
||||||
_byLang.TryGetValue(lang, out supportedLanguage);
|
_byLang.TryGetValue(language, out supportedLanguage);
|
||||||
|
|
||||||
public static SupportedLanguage FromLanguage(Language language) =>
|
public static SupportedLanguage FromLanguage(Language language) =>
|
||||||
_byLang.TryGetValue(language, out var sl)
|
_byLang.TryGetValue(language, out SupportedLanguage? supportedLanguage)
|
||||||
? sl
|
? supportedLanguage
|
||||||
: throw new ArgumentOutOfRangeException(nameof(language), $"Unsupported: {language}");
|
: throw new ArgumentOutOfRangeException(nameof(language), $"Unsupported: {language}");
|
||||||
}
|
}
|
||||||
3
JSMR.Domain/ValueObjects/VoiceWorkSeries.cs
Normal file
3
JSMR.Domain/ValueObjects/VoiceWorkSeries.cs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
namespace JSMR.Domain.ValueObjects;
|
||||||
|
|
||||||
|
public sealed record VoiceWorkSeries(string Identifier, string Name);
|
||||||
8
JSMR.Domain/ValueObjects/VoiceWorkTranslation.cs
Normal file
8
JSMR.Domain/ValueObjects/VoiceWorkTranslation.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using JSMR.Domain.Enums;
|
||||||
|
|
||||||
|
namespace JSMR.Domain.ValueObjects;
|
||||||
|
|
||||||
|
public sealed record VoiceWorkTranslation(
|
||||||
|
string OriginalProductId,
|
||||||
|
Language Language,
|
||||||
|
TranslationKind Kind = TranslationKind.None);
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace JSMR.Infrastructure.Common.Locales;
|
namespace JSMR.Infrastructure.Common.Locales;
|
||||||
|
|
||||||
public class EnglishLocale : ILocale
|
//public class EnglishLocale : ILocale
|
||||||
{
|
//{
|
||||||
public string Abbreviation => "en";
|
// public string Abbreviation => "en";
|
||||||
public string Code => "en_US";
|
// public string Code => "en_US";
|
||||||
}
|
//}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace JSMR.Infrastructure.Common.Locales;
|
namespace JSMR.Infrastructure.Common.Locales;
|
||||||
|
|
||||||
public interface ILocale
|
//public interface ILocale
|
||||||
{
|
//{
|
||||||
string Abbreviation { get; }
|
// string Abbreviation { get; }
|
||||||
string Code { get; }
|
// string Code { get; }
|
||||||
}
|
//}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace JSMR.Infrastructure.Common.Locales;
|
namespace JSMR.Infrastructure.Common.Locales;
|
||||||
|
|
||||||
public class JapaneseLocale : ILocale
|
//public class JapaneseLocale : ILocale
|
||||||
{
|
//{
|
||||||
public string Abbreviation => "jp";
|
// public string Abbreviation => "jp";
|
||||||
public string Code => "ja_JP";
|
// public string Code => "ja_JP";
|
||||||
}
|
//}
|
||||||
@@ -16,25 +16,6 @@ public static class DLSiteToDomainMapper
|
|||||||
private const string OptAIFull = "AIG";
|
private const string OptAIFull = "AIG";
|
||||||
private const string OptAIPartial = "AIP";
|
private const string OptAIPartial = "AIP";
|
||||||
|
|
||||||
private static readonly (string Code, Language Lang)[] SupportedLanguageFlags =
|
|
||||||
[
|
|
||||||
(SupportedLanguage.Japanese.Code, Language.Japanese),
|
|
||||||
(SupportedLanguage.English.Code, Language.English),
|
|
||||||
(SupportedLanguage.ChineseTraditional.Code, Language.ChineseTraditional),
|
|
||||||
(SupportedLanguage.ChineseSimplified.Code, Language.ChineseSimplified)
|
|
||||||
];
|
|
||||||
|
|
||||||
private static readonly (string Code, SupportedLanguage Lang)[] SupportedLanguageFlags2 =
|
|
||||||
[
|
|
||||||
(SupportedLanguage.Japanese.Code, SupportedLanguage.Japanese),
|
|
||||||
(SupportedLanguage.English.Code, SupportedLanguage.English),
|
|
||||||
(SupportedLanguage.ChineseTraditional.Code, SupportedLanguage.ChineseTraditional),
|
|
||||||
(SupportedLanguage.ChineseSimplified.Code, SupportedLanguage.ChineseSimplified)
|
|
||||||
];
|
|
||||||
|
|
||||||
private static readonly Dictionary<string, Language> TranslationLanguageMap =
|
|
||||||
SupportedLanguageFlags.ToDictionary(x => x.Code, x => x.Lang, StringComparer.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
private static readonly Dictionary<int, AgeRating> AgeRatingMap = new()
|
private static readonly Dictionary<int, AgeRating> AgeRatingMap = new()
|
||||||
{
|
{
|
||||||
{ 1, AgeRating.AllAges },
|
{ 1, AgeRating.AllAges },
|
||||||
@@ -89,11 +70,10 @@ public static class DLSiteToDomainMapper
|
|||||||
if (string.IsNullOrWhiteSpace(productInfo.TitleId) || string.IsNullOrWhiteSpace(productInfo.TitleName))
|
if (string.IsNullOrWhiteSpace(productInfo.TitleId) || string.IsNullOrWhiteSpace(productInfo.TitleName))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return new VoiceWorkSeries
|
return new VoiceWorkSeries(
|
||||||
{
|
Identifier: productInfo.TitleId,
|
||||||
Identifier = productInfo.TitleId,
|
Name: productInfo.TitleName
|
||||||
Name = productInfo.TitleName
|
);
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static VoiceWorkTranslation? MapTranslation(ProductInfo info, HashSet<string> options)
|
private static VoiceWorkTranslation? MapTranslation(ProductInfo info, HashSet<string> options)
|
||||||
@@ -108,30 +88,37 @@ public static class DLSiteToDomainMapper
|
|||||||
if (!options.Contains(languageCode))
|
if (!options.Contains(languageCode))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!TranslationLanguageMap.TryGetValue(languageCode, out Language language))
|
if (!SupportedLanguage.TryFromCode(languageCode, out SupportedLanguage? supportedLanguage))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
string originalId = translationInfo.OriginalWorkNumber;
|
string originalId = translationInfo.OriginalWorkNumber;
|
||||||
bool isOfficial = options.Contains(OptOfficialTranslation);
|
|
||||||
bool isRecommended = options.Contains(OptRecommendedTranslation);
|
|
||||||
|
|
||||||
return new VoiceWorkTranslation
|
TranslationKind translationKind = TranslationKind.None;
|
||||||
{
|
|
||||||
OriginalProductId = originalId,
|
if (options.Contains(OptOfficialTranslation))
|
||||||
Language = language,
|
translationKind |= TranslationKind.Official;
|
||||||
IsOfficialTranslation = isOfficial,
|
|
||||||
IsRecommendedTranslation = isRecommended
|
if (options.Contains(OptRecommendedTranslation))
|
||||||
};
|
translationKind |= TranslationKind.Recommended;
|
||||||
|
|
||||||
|
//bool isOfficial = options.Contains(OptOfficialTranslation);
|
||||||
|
//bool isRecommended = options.Contains(OptRecommendedTranslation);
|
||||||
|
|
||||||
|
return new VoiceWorkTranslation(
|
||||||
|
OriginalProductId: originalId,
|
||||||
|
Language: supportedLanguage.Language,
|
||||||
|
Kind: translationKind
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SupportedLanguage[] MapSupportedLanguages(HashSet<string> options)
|
private static SupportedLanguage[] MapSupportedLanguages(HashSet<string> options)
|
||||||
{
|
{
|
||||||
List<SupportedLanguage> languages = [];
|
List<SupportedLanguage> languages = [];
|
||||||
|
|
||||||
foreach (var (code, language) in SupportedLanguageFlags2)
|
foreach (SupportedLanguage supportedLanguage in SupportedLanguage.All)
|
||||||
{
|
{
|
||||||
if (options.Contains(code) && !languages.Contains(language))
|
if (options.Contains(supportedLanguage.Code) && !languages.Contains(supportedLanguage))
|
||||||
languages.Add(language);
|
languages.Add(supportedLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [.. languages];
|
return [.. languages];
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
using JSMR.Domain.ValueObjects;
|
using JSMR.Application.Enums;
|
||||||
using JSMR.Infrastructure.Common.Locales;
|
using JSMR.Domain.ValueObjects;
|
||||||
|
|
||||||
namespace JSMR.Infrastructure.Scanning;
|
namespace JSMR.Infrastructure.Scanning;
|
||||||
|
|
||||||
public class DLSiteSearchFilterBuilder
|
public sealed class DLSiteSearchFilterBuilder
|
||||||
{
|
{
|
||||||
private readonly List<string> _optionsAnd = [];
|
private readonly List<string> _optionsAnd = [];
|
||||||
private readonly List<string> _optionsNot = [];
|
private readonly List<string> _optionsNot = [];
|
||||||
private readonly List<string> _excludedMakers = [];
|
private readonly List<string> _excludedMakers = [];
|
||||||
|
|
||||||
private ILocale _locale = new JapaneseLocale();
|
private Locale _locale = Locale.Japanese;
|
||||||
|
|
||||||
private void AddToOptionsAnd(string value)
|
private void AddToOptionsAnd(string value)
|
||||||
{
|
{
|
||||||
@@ -27,7 +27,7 @@ public class DLSiteSearchFilterBuilder
|
|||||||
_optionsNot.Add(value);
|
_optionsNot.Add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DLSiteSearchFilterBuilder UseLocale(ILocale locale)
|
public DLSiteSearchFilterBuilder UseLocale(Locale locale)
|
||||||
{
|
{
|
||||||
_locale = locale;
|
_locale = locale;
|
||||||
|
|
||||||
@@ -90,12 +90,12 @@ public class DLSiteSearchFilterBuilder
|
|||||||
|
|
||||||
public string BuildSearchQuery(int pageNumber, int pageSize)
|
public string BuildSearchQuery(int pageNumber, int pageSize)
|
||||||
{
|
{
|
||||||
ILocale locale = _locale ?? new JapaneseLocale();
|
var (localeAbbreviation, localeCode) = LocaleMap.Map[_locale];
|
||||||
|
|
||||||
using (var writer = new StringWriter())
|
using (var writer = new StringWriter())
|
||||||
{
|
{
|
||||||
writer.Write($"https://www.dlsite.com/maniax/");
|
writer.Write($"https://www.dlsite.com/maniax/");
|
||||||
writer.Write($"fsr/=/language/{locale.Abbreviation}/");
|
writer.Write($"fsr/=/language/{localeAbbreviation}/");
|
||||||
|
|
||||||
writer.Write("sex_category[0]/male/");
|
writer.Write("sex_category[0]/male/");
|
||||||
writer.Write("ana_flg/all/");
|
writer.Write("ana_flg/all/");
|
||||||
@@ -129,7 +129,7 @@ public class DLSiteSearchFilterBuilder
|
|||||||
writer.Write($"per_page/{pageSize}/");
|
writer.Write($"per_page/{pageSize}/");
|
||||||
writer.Write($"page/{pageNumber}/");
|
writer.Write($"page/{pageNumber}/");
|
||||||
writer.Write("show_type/1/");
|
writer.Write("show_type/1/");
|
||||||
writer.Write($"?locale={locale.Code}");
|
writer.Write($"?locale={localeCode}");
|
||||||
|
|
||||||
return writer.ToString();
|
return writer.ToString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using JSMR.Domain.ValueObjects;
|
using JSMR.Application.Enums;
|
||||||
using JSMR.Infrastructure.Common.Locales;
|
using JSMR.Domain.ValueObjects;
|
||||||
using JSMR.Infrastructure.Common.SupportedLanguages;
|
|
||||||
|
|
||||||
namespace JSMR.Infrastructure.Scanning;
|
namespace JSMR.Infrastructure.Scanning;
|
||||||
|
|
||||||
@@ -8,12 +7,12 @@ public static class DLSiteSearchFilterBuilderExtensions
|
|||||||
{
|
{
|
||||||
public static DLSiteSearchFilterBuilder UseDefaultLocale(this DLSiteSearchFilterBuilder searchFilterBuilder)
|
public static DLSiteSearchFilterBuilder UseDefaultLocale(this DLSiteSearchFilterBuilder searchFilterBuilder)
|
||||||
{
|
{
|
||||||
return searchFilterBuilder.UseLocale(new JapaneseLocale());
|
return searchFilterBuilder.UseLocale(Locale.Japanese);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DLSiteSearchFilterBuilder UseEnglishLocale(this DLSiteSearchFilterBuilder searchFilterBuilder)
|
public static DLSiteSearchFilterBuilder UseEnglishLocale(this DLSiteSearchFilterBuilder searchFilterBuilder)
|
||||||
{
|
{
|
||||||
return searchFilterBuilder.UseLocale(new EnglishLocale());
|
return searchFilterBuilder.UseLocale(Locale.English);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DLSiteSearchFilterBuilder IncludeJapaneseSupportedLanguage(this DLSiteSearchFilterBuilder searchFilterBuilder)
|
public static DLSiteSearchFilterBuilder IncludeJapaneseSupportedLanguage(this DLSiteSearchFilterBuilder searchFilterBuilder)
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using JSMR.Application.Common;
|
using JSMR.Application.Enums;
|
||||||
using JSMR.Domain.ValueObjects;
|
using JSMR.Domain.ValueObjects;
|
||||||
using JSMR.Infrastructure.Common.Locales;
|
|
||||||
using JSMR.Infrastructure.Common.SupportedLanguages;
|
|
||||||
using JSMR.Infrastructure.Http;
|
using JSMR.Infrastructure.Http;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -16,7 +14,7 @@ public partial class EnglishVoiceWorksScanner(IHtmlLoader loader) : VoiceWorksSc
|
|||||||
[GeneratedRegex(@"^(Early|Middle|Late)\s(.*?)\s(\d{4})", RegexOptions.IgnoreCase, "en-US")]
|
[GeneratedRegex(@"^(Early|Middle|Late)\s(.*?)\s(\d{4})", RegexOptions.IgnoreCase, "en-US")]
|
||||||
private static partial Regex EstimatedDateRegex();
|
private static partial Regex EstimatedDateRegex();
|
||||||
|
|
||||||
protected override ILocale Locale => new EnglishLocale();
|
protected override Locale Locale => Locale.English;
|
||||||
|
|
||||||
protected override SupportedLanguage[] SupportedLanguages =>
|
protected override SupportedLanguage[] SupportedLanguages =>
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using JSMR.Application.Common;
|
using JSMR.Application.Enums;
|
||||||
using JSMR.Domain.ValueObjects;
|
using JSMR.Domain.ValueObjects;
|
||||||
using JSMR.Infrastructure.Common.Locales;
|
|
||||||
using JSMR.Infrastructure.Common.SupportedLanguages;
|
|
||||||
using JSMR.Infrastructure.Http;
|
using JSMR.Infrastructure.Http;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
@@ -15,7 +13,7 @@ public partial class JapaneseVoiceWorksScanner(IHtmlLoader loader) : VoiceWorksS
|
|||||||
[GeneratedRegex("販売日: (.*?)年(.*?)月(.*)日", RegexOptions.IgnoreCase, "en-US")]
|
[GeneratedRegex("販売日: (.*?)年(.*?)月(.*)日", RegexOptions.IgnoreCase, "en-US")]
|
||||||
private static partial Regex SalesDateRegex();
|
private static partial Regex SalesDateRegex();
|
||||||
|
|
||||||
protected override ILocale Locale => new JapaneseLocale();
|
protected override Locale Locale => Locale.Japanese;
|
||||||
|
|
||||||
protected override SupportedLanguage[] SupportedLanguages =>
|
protected override SupportedLanguage[] SupportedLanguages =>
|
||||||
[
|
[
|
||||||
|
|||||||
16
JSMR.Infrastructure/Scanning/LocaleMap.cs
Normal file
16
JSMR.Infrastructure/Scanning/LocaleMap.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using JSMR.Application.Enums;
|
||||||
|
|
||||||
|
namespace JSMR.Infrastructure.Scanning;
|
||||||
|
|
||||||
|
internal class LocaleMap
|
||||||
|
{
|
||||||
|
public static readonly IReadOnlyDictionary<Locale, (string Abbreviation, string Code)> Map =
|
||||||
|
new Dictionary<Locale, (string, string)>
|
||||||
|
{
|
||||||
|
{ Locale.Japanese, ("jp", "ja_JP") },
|
||||||
|
{ Locale.English, ("en", "en_US") },
|
||||||
|
{ Locale.ChineseSimplified, ("zh-cn", "zh_CN") },
|
||||||
|
{ Locale.ChineseTraditional, ("zh-tw", "zh_TW") },
|
||||||
|
{ Locale.Korean, ("ko", "ko_KR") },
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using HtmlAgilityPack;
|
using HtmlAgilityPack;
|
||||||
|
using JSMR.Application.Enums;
|
||||||
using JSMR.Application.Scanning.Contracts;
|
using JSMR.Application.Scanning.Contracts;
|
||||||
using JSMR.Application.Scanning.Ports;
|
using JSMR.Application.Scanning.Ports;
|
||||||
using JSMR.Domain.Enums;
|
using JSMR.Domain.Enums;
|
||||||
using JSMR.Domain.ValueObjects;
|
using JSMR.Domain.ValueObjects;
|
||||||
using JSMR.Infrastructure.Common.Locales;
|
|
||||||
using JSMR.Infrastructure.Http;
|
using JSMR.Infrastructure.Http;
|
||||||
using JSMR.Infrastructure.Scanning.Models;
|
using JSMR.Infrastructure.Scanning.Models;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -13,7 +13,7 @@ namespace JSMR.Infrastructure.Scanning;
|
|||||||
|
|
||||||
public abstract class VoiceWorksScanner(IHtmlLoader htmlLoader) : IVoiceWorksScanner
|
public abstract class VoiceWorksScanner(IHtmlLoader htmlLoader) : IVoiceWorksScanner
|
||||||
{
|
{
|
||||||
protected abstract ILocale Locale { get; }
|
protected abstract Locale Locale { get; }
|
||||||
protected abstract SupportedLanguage[] SupportedLanguages { get; }
|
protected abstract SupportedLanguage[] SupportedLanguages { get; }
|
||||||
|
|
||||||
protected abstract DateOnly? GetEstimatedReleaseDate(string expectedDate);
|
protected abstract DateOnly? GetEstimatedReleaseDate(string expectedDate);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class DLSiteClientTests
|
|||||||
result["RJ01230163"].HasTrial.ShouldBeTrue();
|
result["RJ01230163"].HasTrial.ShouldBeTrue();
|
||||||
result["RJ01230163"].HasDLPlay.ShouldBeTrue();
|
result["RJ01230163"].HasDLPlay.ShouldBeTrue();
|
||||||
result["RJ01230163"].HasReviews.ShouldBeTrue();
|
result["RJ01230163"].HasReviews.ShouldBeTrue();
|
||||||
result["RJ01230163"].SupportedLanguages.Length.ShouldBe(1);
|
result["RJ01230163"].SupportedLanguages.Count.ShouldBe(1);
|
||||||
result["RJ01230163"].SupportedLanguages.Select(x => x.Language).ShouldContain(Language.English);
|
result["RJ01230163"].SupportedLanguages.Select(x => x.Language).ShouldContain(Language.English);
|
||||||
result["RJ01230163"].DownloadCount.ShouldBe(659);
|
result["RJ01230163"].DownloadCount.ShouldBe(659);
|
||||||
result["RJ01230163"].WishlistCount.ShouldBe(380);
|
result["RJ01230163"].WishlistCount.ShouldBe(380);
|
||||||
@@ -78,7 +78,7 @@ public class DLSiteClientTests
|
|||||||
voiceWorkDetails.Series.Identifier.ShouldBe("SE0001");
|
voiceWorkDetails.Series.Identifier.ShouldBe("SE0001");
|
||||||
voiceWorkDetails.Series.Name.ShouldBe("Series 1");
|
voiceWorkDetails.Series.Name.ShouldBe("Series 1");
|
||||||
|
|
||||||
voiceWorkDetails.SupportedLanguages.Length.ShouldBe(1);
|
voiceWorkDetails.SupportedLanguages.Count.ShouldBe(1);
|
||||||
voiceWorkDetails.SupportedLanguages[0].Language.ShouldBe(Language.Japanese);
|
voiceWorkDetails.SupportedLanguages[0].Language.ShouldBe(Language.Japanese);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user