Updated various parts of scanning and ingestion, either for bug fixes, or for enhancements.
All checks were successful
ci / build-test (push) Successful in 2m22s
ci / publish-image (push) Has been skipped

This commit is contained in:
2026-03-01 22:07:20 -05:00
parent 704a6fc433
commit 83655f13e9
20 changed files with 555 additions and 90 deletions

View File

@@ -0,0 +1,62 @@
using JSMR.Application.Scanning.Contracts;
using JSMR.Domain.Entities;
using JSMR.Domain.Enums;
using JSMR.Domain.ValueObjects;
using JSMR.Infrastructure.Data;
using JSMR.Tests.Fixtures;
using Microsoft.EntityFrameworkCore;
using Shouldly;
namespace JSMR.Tests.Ingestion.Japanese;
public class Update_Upcoming_With_No_Expected_Date_Tests(MariaDbContainerFixture container) : JapaneseIngestionTestsBase(container)
{
[Fact]
public async Task Update_Upcoming_With_No_Expected_Date()
{
VoiceWorkIngest ingest = new()
{
MakerId = "RG00001",
MakerName = "Some Maker",
ProductId = "RJ1000001",
Title = "Some Upcoming Work",
Description = "Something is coming.",
Tags = [],
Creators = [],
WishlistCount = 250,
Downloads = 0,
HasTrial = false,
HasDLPlay = false,
StarRating = null,
Votes = null,
AgeRating = AgeRating.R15,
HasImage = true,
SupportedLanguages = [SupportedLanguage.Japanese],
SalesDate = null,
ExpectedDate = new DateOnly(2025, 1, 21),
RegistrationDate = null
};
await using AppDbContext dbContext = await GetAppDbContextAsync();
DateTime currentDateTime = TokyoLocalToUtc(2025, 01, 05, 10, 0, 0);
await UpsertAndVerify(dbContext, TokyoLocalToUtc(2025, 01, 05, 10, 0, 0), ingest, new DateTime(2025, 1, 21));
VoiceWorkIngest updatedIngest = ingest with
{
ExpectedDate = null
};
// Should be exactly the same
await UpsertAndVerify(dbContext, TokyoLocalToUtc(2025, 01, 05, 10, 0, 0), ingest, new DateTime(2025, 1, 21));
}
private static async Task UpsertAndVerify(AppDbContext dbContext, DateTime dateTime, VoiceWorkIngest ingest, DateTime? expectedDate)
{
await UpsertAsync(dbContext, dateTime, [ingest]);
VoiceWork? voiceWork = await dbContext.VoiceWorks.SingleAsync(v => v.ProductId == ingest.ProductId, TestContext.Current.CancellationToken);
voiceWork.ShouldNotBeNull();
voiceWork.ExpectedDate.ShouldBe(expectedDate);
}
}