fix(archive): keep project frame positions on their frames after inserts

The project names frames by position (exclusions, hero, virtual-camera
keyframes), and an upload, import, scan or sync download of earlier photos
merges them by capture time and renumbers the frames after them; nothing
moved the project, so a render excluded the wrong photo and the project's
hero no longer matched the Library's.

project.json keeps its format: when the index takes a sidecar in which frames
were inserted before indexed ones, the index's copy of the project has its
positions moved from the indexed order to the new one in the same transaction
as the frame rows, and project.json mirrors it unless another writer changed
it meanwhile. The JSON is edited in place, so members a newer Titano wrote
survive; only an insertion is followed (if an indexed frame is gone, the
positions stay). The settings version stays, so a synced copy receiving the
same frames makes the same move (CD-2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 09:40:40 +00:00
1 parent 94b13cc064
commit 01e17c9961
7 files changed
+252 -3

No files matched your search

+1 -1
View File
@@ -456,7 +456,7 @@ public sealed class ArchiveIngest : IArchiveIngest
/// <summary>
/// Appends the new rows when the index was in step with the sidecar; otherwise (or when frames were repaired, whose
/// flags change) resyncs the whole sequence.
/// flags change) resyncs the whole sequence, which also moves the project's frame positions after an insertion.
/// </summary>
private async Task IndexAsync(Archive archive, SequencePaths sequence, SequenceManifest manifest, int before, List<SidecarFrame> appended,
bool repaired, CancellationToken cancellationToken)