fix(archive): partial writers keep the folder changed for the scan; image flags follow queued passes and hashed photos
Writers that change part of a sequence (decode tiers, image-pass flags, analyses, verify flushes and stamps, duplicate flags, title/tags/rating/ notes edits, mass rename) now ask ArchiveIndexer.InStepAsync before their own sidecar write and record the folder's scan stamps afterwards only when the index held the folder as it was: the stored stamps are still the folder's and the row holds the sidecar's frames. What another process changed in the sidecar alone (frames, a new title) stays visible to the next incremental scan, which writes the whole row from the sidecar. EditSequenceInfoAsync reads sidecar and row under the lease and writes the row through SequenceRepository.EditAsync at the settings version it read, applying the edit again on a conflict, then the sidecar from the stored row; settings and frames committed meanwhile stay. MassRenamer writes only folder and title (RelocateAsync, whose null title now keeps the current one). Verify flushes and duplicate flags run under one lease. A scan that finds frames another writer listed in the sidecar itself clears AnalyzedLight, ThumbsBuilt and ProxiesBuilt only in its own row and only on a server (ImagesAfterScan); the shared sidecar keeps the writer's flags, so a desktop's poll no longer makes the server redo its passes. An image pass overtaken by an upload keeps its flag while a pass of the same kind is queued for the sequence. ThumbPack.IsFrom accepts a thumbnail drawn before a verify hashed its photo, in the pass, in SameFrames and in the server's thumbnail lookup, which answered 404 for every such frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
18 files changed
+532
-116
No files matched your search
@@ -101,15 +101,12 @@ internal sealed class SequenceAnalyser(TitanoDatabase db, ProcessingOptions opti
|
||||
// Without a current report (none, or made before frames were added) the deep status no longer holds.
|
||||
var clear = (report is null ? SequenceStatus.AnalyzedDeep : SequenceStatus.None) | (warnings > 0 ? SequenceStatus.None : SequenceStatus.HasWarnings);
|
||||
var manifest = SequenceWriter.ReadLocked(folder, sequence.Id);
|
||||
var inStep = await indexer.InStepAsync(archive, folder, manifest, cancellationToken).ConfigureAwait(false);
|
||||
var status = (manifest.Status | set) & ~clear;
|
||||
if (status != manifest.Status)
|
||||
{
|
||||
manifest = manifest with { Status = status, UpdatedAt = DateTimeOffset.UtcNow };
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest);
|
||||
}
|
||||
if (status != manifest.Status) ManifestStore.WriteSequence(folder.ManifestPath, manifest with { Status = status, UpdatedAt = DateTimeOffset.UtcNow });
|
||||
var summary = deep && report is not null ? AnalysisSummary.From(report).ToJson() : null;
|
||||
await db.Sequences.RecordAnalysisAsync(sequence.Id, set, clear, warnings, summary, cancellationToken).ConfigureAwait(false);
|
||||
await indexer.RecordStampsInStepAsync(archive, folder, manifest, cancellationToken).ConfigureAwait(false);
|
||||
if (inStep) await indexer.RecordStampsAsync(archive, folder, sequence.Id, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (changed) await options.NotifyAsync(sequence.Id, ProcessingOptions.SettingsChange, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in new issue
Block a user