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
@@ -6,6 +6,7 @@ using Titano.Core.Model;
|
||||
using Titano.Core.Naming;
|
||||
using Titano.Data.Archiving.Jobs;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Processing;
|
||||
using Titano.Data.Repositories;
|
||||
|
||||
namespace Titano.Data.Archiving;
|
||||
@@ -284,11 +285,29 @@ public sealed class ArchiveService : IJobHandlerProvider
|
||||
public async Task<OrphanReport> FindOrphansAsync(Guid archiveId, CancellationToken cancellationToken = default) =>
|
||||
await Maintenance.FindOrphansAsync(await LoadArchiveAsync(archiveId, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
/// <summary>Orphans fix: index the unlisted photos of a sequence and flag its missing files.</summary>
|
||||
public async Task ReconcileAsync(Guid sequenceId, CancellationToken cancellationToken = default)
|
||||
/// <summary>
|
||||
/// Orphans fix: index the unlisted photos of a sequence and flag its missing files. Photos added, gone or back clear
|
||||
/// what covered the frames, as a scan's reconcile does (<see cref="ArchiveIndexer.ReconcileAsync"/>), and what a scan's
|
||||
/// follow-ups would make again is queued on <paramref name="followUps"/> (null: nothing): the light analysis and, on a
|
||||
/// server (<see cref="ArchiveServiceOptions.ImagesAfterScan"/>), the thumbnails and proxies. A kind the engine does
|
||||
/// not run, or already queued for the sequence, is left out.
|
||||
/// </summary>
|
||||
public async Task ReconcileAsync(Guid sequenceId, JobEngine? followUps, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var (archive, sequence) = await LoadSequenceAsync(sequenceId, cancellationToken).ConfigureAwait(false);
|
||||
await Indexer.ReconcileAsync(archive, sequence, cancellationToken).ConfigureAwait(false);
|
||||
if (!await Indexer.ReconcileAsync(archive, sequence, cancellationToken).ConfigureAwait(false) || followUps is null) return;
|
||||
List<ArchiveJobRequest> requests = [ProcessingJobs.LightAnalysis([sequenceId], sequence.DisplayTitle)];
|
||||
if (_writer.Options.ImagesAfterScan)
|
||||
{
|
||||
requests.Add(ArchiveJobs.Thumbnails([sequenceId], sequence.DisplayTitle));
|
||||
// An archive whose policy makes no proxies would get a pass that does nothing.
|
||||
if (archive.ProxyLongEdge != ProxyPolicy.Disabled) requests.Add(ArchiveJobs.Proxies([sequenceId], sequence.DisplayTitle));
|
||||
}
|
||||
foreach (var request in requests)
|
||||
{
|
||||
if (!followUps.Runs(request.Kind) || await _db.Jobs.IsQueuedAsync(request.Kind, sequenceId, cancellationToken).ConfigureAwait(false)) continue;
|
||||
await followUps.EnqueueAsync(request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Orphans fix: drop index rows whose sidecar is gone.</summary>
|
||||
|
||||
Reference in new issue
Block a user