fix(archive): exports follow a Reorganize folder move; writers resolve the folder under the lease
A Reorganize step that moves a sequence folder carries its exports/ with it, but only the sequences and frames rows followed: renders.output_path kept naming the old folder, so the server answered 404 for the export, Get/Send exports and Reveal lost it, and no scan or trash restore could repair it. RenderRepository.RebaseFolderAsync now rewrites the archive-relative output paths of the step's sequence in the same transaction as the frames (idempotent on resume; absolute outputs and the archive root are untouched). Writers that read a sequence row before taking its lease wrote into the folder a Reorganize had moved meanwhile, creating it again (project.json from the editor or a sync, a thumbnail pack) or failing on its missing sidecar. They now take the folder from the index row read under the lease (SequenceWriter.FolderAsync): the editor's save refuses with FramesChangedException and reloads at the new folder, FramesCurrentAsync reports a moved folder, and the sync apply, project store, thumbnail pass and its status, decode tiers, analyses, verify, info edits, ingest, duplicate flags, pack compaction and photo restores write where the sequence is now; a photo deletion planned before the move is refused as stale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit be28d8acf0d96012c94a266f8af61e9bbafaa28d)
This commit is contained in:
1 parent
b253cac8d4
commit
9ce201cd70
22 files changed
+343
-35
No files matched your search
@@ -578,7 +578,8 @@ public sealed class MassRenamer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sidecar title, then index (folder, title, frames' paths); each part is idempotent so a resumed step can repeat it.
|
||||
/// Sidecar title, then index (folder, title, frames' paths and the paths of renders whose export moved with the
|
||||
/// folder, in one transaction); each part is idempotent so a resumed step can repeat it.
|
||||
/// The index row changes in its folder and title only (<see cref="SequenceRepository.RelocateAsync"/>): a settings edit
|
||||
/// committed meanwhile stays, and frames another process listed in the sidecar are left to the next scan, for which
|
||||
/// the folder keeps no stamps unless the index held it as it was
|
||||
@@ -606,7 +607,11 @@ public sealed class MassRenamer
|
||||
await using (var tx = await _db.BeginAsync(cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
await tx.Sequences.RelocateAsync(step.SequenceId, step.ToFolder, retitle ? step.ToTitle : null, cancellationToken).ConfigureAwait(false);
|
||||
if (step.MovesFolder) await tx.Frames.RebaseFolderAsync(step.SequenceId, step.FromFolder, step.ToFolder, cancellationToken).ConfigureAwait(false);
|
||||
if (step.MovesFolder)
|
||||
{
|
||||
await tx.Frames.RebaseFolderAsync(step.SequenceId, step.FromFolder, step.ToFolder, cancellationToken).ConfigureAwait(false);
|
||||
await tx.Renders.RebaseFolderAsync(step.SequenceId, step.FromFolder, step.ToFolder, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
await tx.Archives.DeleteFolderStateAsync(archive.Id, step.FromFolder, cancellationToken).ConfigureAwait(false);
|
||||
await tx.CommitAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user