fix(archive): the orphans fix clears what covered the frames and queues their analysis
The Archive screen's orphans fix indexed photos copied in by hand but left AnalyzedLight, ThumbsBuilt and ProxiesBuilt set and recorded the folder's stamps, so no scan came back to it and the light analysis was never redone: Auto values, warnings and preview-only tiers stayed those of the old frames. It now clears the three flags in the sidecar and the row as a scan's reconcile does, and queues the light analysis on the host's engine (on a server, the thumbnails and proxies too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
5 files changed
+124
-17
No files matched your search
@@ -82,6 +82,42 @@ public sealed class AnalysisFollowUpTests(TestContext context)
|
||||
Assert.True(ManifestStore.ReadSequence(fx.Folder(sequence).ManifestPath).Status.HasFlag(SequenceStatus.AnalyzedLight), "sidecar status");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task PhotosTheOrphansFixIndexesAreAnalysedAgain()
|
||||
{
|
||||
await using var fx = await ProcessingFixture.CreateAsync(context);
|
||||
var sequence = await fx.AddAsync(SyntheticSequence.Create(new SyntheticSequenceOptions { FrameCount = 12 }), "Roof");
|
||||
var folder = fx.Folder(sequence);
|
||||
await fx.StartEngineAsync(withArchive: true);
|
||||
var first = await fx.EnqueueAsync(Titano.Data.Processing.ProcessingJobs.LightAnalysis([sequence.Id]));
|
||||
await fx.WaitForAsync(first.Id, JobState.Done);
|
||||
// A server sharing the archive drew the twelve frames and made their proxies.
|
||||
const SequenceStatus images = SequenceStatus.ThumbsBuilt | SequenceStatus.ProxiesBuilt;
|
||||
var manifest = ManifestStore.ReadSequence(folder.ManifestPath);
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest with { Status = manifest.Status | images });
|
||||
await fx.Db.Sequences.UpdateStatusAsync(sequence.Id, images, SequenceStatus.None, fx.Ct);
|
||||
|
||||
// Photos copied into the folder by hand: the Archive screen's orphans check lists them, and its fix indexes them. The
|
||||
// light analysis it queues waits on the first new photo's probe, so what the fix left can be seen.
|
||||
fx.Write(SyntheticSequence.Create(new SyntheticSequenceOptions { FrameCount = 18 }), "Roof", first: 12);
|
||||
fx.Decoder.HoldProbeOf(12);
|
||||
await fx.Archive.Service.ReconcileAsync(sequence.Id, fx.Engine, fx.Ct);
|
||||
const SequenceStatus covering = SequenceStatus.AnalyzedLight | images;
|
||||
var row = (await fx.Db.Sequences.GetAsync(sequence.Id, fx.Ct))!;
|
||||
Assert.Equal((18, SequenceStatus.None), (row.FrameCount, row.Status & covering));
|
||||
Assert.Equal(SequenceStatus.None, ManifestStore.ReadSequence(folder.ManifestPath).Status & covering);
|
||||
var again = (await fx.Db.Jobs.ListAsync(null, JobKind.LightAnalyse, cancellationToken: fx.Ct)).Items.Single(j => j.Id != first.Id);
|
||||
Assert.SequenceEqual([sequence.Id], again.TargetIds);
|
||||
|
||||
await fx.Decoder.Holding.Task.WaitAsync(TimeSpan.FromSeconds(60), fx.Ct);
|
||||
fx.Decoder.Release();
|
||||
await fx.WaitForAsync(again.Id, JobState.Done);
|
||||
row = (await fx.Db.Sequences.GetAsync(sequence.Id, fx.Ct))!;
|
||||
Assert.True(row.Status.HasFlag(SequenceStatus.AnalyzedLight), "analysed again");
|
||||
Assert.True(ManifestStore.ReadSequence(folder.ManifestPath).Status.HasFlag(SequenceStatus.AnalyzedLight), "sidecar status");
|
||||
Assert.Contains("18", ProjectSettings.FromJson(await File.ReadAllTextAsync(folder.ProjectPath, fx.Ct)).Timing.FrameRate.ReasonArgs!);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AScanAskedForDeepAnalysisQueuesItInTheBackgroundForNewSequencesOnly()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user