Hero: renderer logt per ronde hoeveel foto's wachten op varianten of volledig voorbeeld

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 08:07:59 +01:00
co-authored by Claude Sonnet 5.5
parent 8dc09ec6e5
commit 3832a7d592
3 changed files with 28 additions and 0 deletions
@@ -33,6 +33,9 @@ public interface IHeroImageService
/// <exception cref="ImageRejectedException">The upload is refused; see the code.</exception>
Task<HeroImageDto> UploadAsync(Stream upload, long declaredLength, Guid callerId, CancellationToken cancellationToken);
/// <summary>How many images exist, how many wait for their variants and how many only lack the full-frame preview (for the log).</summary>
Task<(int Total, int NeedRender, int NeedPreview)> GetRenderBacklogAsync(CancellationToken cancellationToken);
/// <summary>
/// Records a changed focus (general and optionally per ratio) on a tracked image. Nothing is cut here: the caller saves
/// the image together with the hero and then calls <see cref="NotifyPending"/>; the background renderer cuts the new set
@@ -188,6 +191,9 @@ public class HeroImageService(
signal?.Notify();
}
public async Task<(int Total, int NeedRender, int NeedPreview)> GetRenderBacklogAsync(CancellationToken cancellationToken)
=> (await repository.CountImagesAsync(cancellationToken), (await repository.GetImagesNeedingRenderAsync(cancellationToken)).Count, (await repository.GetImagesNeedingPreviewAsync(cancellationToken)).Count);
public async Task<Guid?> RenderNextPendingAsync(IReadOnlySet<Guid> skip, CancellationToken cancellationToken)
{
var image = (await repository.GetImagesNeedingRenderAsync(cancellationToken)).FirstOrDefault(i => !skip.Contains(i.Id));