Updated integration testing for English and Japanese. Fixed minor voice work updater issue. Updated to XUnitV3.
This commit is contained in:
@@ -97,15 +97,12 @@ public class EnglishVoiceWorkUpdater(AppDbContext dbContext, ILanguageIdentifier
|
||||
englishVoiceWork.Description = ingest.Description;
|
||||
englishVoiceWork.IsValid = true;
|
||||
|
||||
switch (dbContext.Entry(englishVoiceWork).State)
|
||||
return dbContext.Entry(englishVoiceWork).State switch
|
||||
{
|
||||
case EntityState.Added:
|
||||
return VoiceWorkUpsertStatus.Inserted;
|
||||
case EntityState.Modified:
|
||||
return VoiceWorkUpsertStatus.Updated;
|
||||
default:
|
||||
return VoiceWorkUpsertStatus.Unchanged;
|
||||
}
|
||||
EntityState.Added => VoiceWorkUpsertStatus.Inserted,
|
||||
EntityState.Modified => VoiceWorkUpsertStatus.Updated,
|
||||
_ => VoiceWorkUpsertStatus.Unchanged,
|
||||
};
|
||||
}
|
||||
|
||||
private EnglishVoiceWork GetOrAddEnglishVoiceWork(VoiceWorkIngest ingest, EnglishVoiceWorkUpsertContext upsertContext)
|
||||
|
||||
@@ -105,7 +105,7 @@ public class VoiceWorkUpdater(AppDbContext dbContext, ITimeProvider timeProvider
|
||||
return;
|
||||
}
|
||||
|
||||
if (upsertContext.VoiceWorks.TryGetValue(ingest.MakerId, out VoiceWork? voiceWork) == false)
|
||||
if (upsertContext.VoiceWorks.TryGetValue(ingest.ProductId, out VoiceWork? voiceWork) == false)
|
||||
return;
|
||||
|
||||
int ingestDownloads = ingest.Downloads;
|
||||
|
||||
@@ -7,13 +7,12 @@ public static class ScannerUtilities
|
||||
{
|
||||
public static List<string> GetStringListFromNodes(HtmlNode[] nodes)
|
||||
{
|
||||
return nodes
|
||||
return [.. nodes
|
||||
.Where(node => string.IsNullOrEmpty(node.InnerHtml) == false)
|
||||
.Select(node => HttpUtility.HtmlDecode(node.InnerHtml))
|
||||
.ToList();
|
||||
.Select(node => HttpUtility.HtmlDecode(node.InnerHtml))];
|
||||
}
|
||||
|
||||
public static string GetDecodedText(HtmlNode node)
|
||||
public static string GetDecodedText(HtmlNode? node)
|
||||
{
|
||||
if (node == null)
|
||||
return string.Empty;
|
||||
|
||||
@@ -127,7 +127,7 @@ public abstract class VoiceWorksScanner(IHtmlLoader htmlLoader) : IVoiceWorksSca
|
||||
return AgeRating.R18;
|
||||
}
|
||||
|
||||
private static ScannedRating? GetScannedRating(HtmlNode starRatingNode)
|
||||
private static ScannedRating? GetScannedRating(HtmlNode? starRatingNode)
|
||||
{
|
||||
if (starRatingNode == null)
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user