feat(archive): reorganize existing sequences with folder, file and title templates

Owner review 2, R7 asks for renaming and moving after import, on the web panel and the
desktop. This is the engine and the server API both UIs build on.

- FrameNaming (Core/Naming) is the one naming context and unique-name rule of a frame:
  imports, uploads and Reorganize now produce identical names (behaviour of the ingest and
  the import planner unchanged).
- RenamePlanner takes a file template: each step counts its renamed frames, shows the first
  three and the frames version they were planned at, and lists what keeps its name (photos
  in place outside originals/, never hashed, missing, unreadable sidecar). Names are given
  in index order with _2, _3 as filing does; XMP companions follow their photo.
- MassRenamer renames a step's files under the same leases after its folder moved, checks
  the frames version, journals .chronos/rename-files.json and moves files in two phases
  through temporary names so chains and swaps never meet; then sidecar, index
  (FrameRepository.RenameFilesAsync, both dialects) and journal. A failure puts every file
  back; a crash is completed by the next writer or the plan's resume, the index following.
  Plans a paused or cancelled job holds are left to that job.
- JobKind.Move gets MoveJobHandler: it plans again and applies only the confirmed plan
  (fingerprint and frames versions), with progress and checkpoints per sequence.
- POST /api/v1/archive/reorganize: dry run with the plan and its fingerprint, otherwise a
  202 move job; validated templates, audited, sequenceChanged reorganized events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit aae1c3eb18ea932b4a6251c5e2a282b9295a5785)
This commit is contained in:
Alby96 committed 2026-10-27 14:03:36 +01:00
1 parent 81cf58227d
commit eb2395d9b0
36 files changed
+2238 -164

No files matched your search

+1 -1
View File
@@ -138,7 +138,7 @@
<data name="Admin.Job.Kind.Import" xml:space="preserve"><value>Import</value></data>
<data name="Admin.Job.Kind.LightAnalyse" xml:space="preserve"><value>Light analysis</value></data>
<data name="Admin.Job.Kind.Maintenance" xml:space="preserve"><value>Maintenance</value></data>
<data name="Admin.Job.Kind.Move" xml:space="preserve"><value>Move</value></data>
<data name="Admin.Job.Kind.Move" xml:space="preserve"><value>Reorganize</value></data>
<data name="Admin.Job.Kind.Orphans" xml:space="preserve"><value>Orphans</value></data>
<data name="Admin.Job.Kind.Proxies" xml:space="preserve"><value>Proxies</value></data>
<data name="Admin.Job.Kind.Rebuild" xml:space="preserve"><value>Rebuild</value></data>
+10
View File
@@ -86,6 +86,8 @@
<data name="Archive.Error.NewerFormat" xml:space="preserve"><value>{0} was written by a newer Chronos (format {1}).</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.Offline" xml:space="preserve"><value>The archive {0} is offline.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.ReadOnly" xml:space="preserve"><value>The archive {0} is read-only.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.ReorganizeKept.one" xml:space="preserve"><value>{0:N0} sequence was not reorganized as planned: it changed after the plan.</value><comment>long: error sentence of a Reorganize job</comment></data>
<data name="Archive.Error.ReorganizeKept.other" xml:space="preserve"><value>{0:N0} sequences were not reorganized as planned: they changed after the plan.</value><comment>long: error sentence of a Reorganize job</comment></data>
<data name="Archive.Error.SourceChanged" xml:space="preserve"><value>{0} changed after the plan was made.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.SourceGone" xml:space="preserve"><value>The card or folder {0} is no longer available.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.StalePlan" xml:space="preserve"><value>The archive changed after this plan was made.</value><comment>long: error sentence</comment></data>
@@ -151,6 +153,10 @@
<data name="Archive.Log.Orphans" xml:space="preserve"><value>Unindexed photos: {0}, missing photos: {1}</value><comment>long: job log line</comment></data>
<data name="Archive.Log.ProxiesDone" xml:space="preserve"><value>{0}: made {1}, reused {2}, unreadable {3}, waiting {4}</value><comment>long: job log line; {4} frames whose proxy this host waits for from a client or render node</comment></data>
<data name="Archive.Log.ProxiesSent" xml:space="preserve"><value>Proxies for the server: {0} sent, {1} not sent</value><comment>long: job log line; {0} proxies sent; {1} proxies this PC could not make or the server refused</comment></data>
<data name="Archive.Log.ReorganizeDropped" xml:space="preserve"><value>Left as it was, changed after the plan: {0}</value><comment>long: job log line; {0} sequence title or folder</comment></data>
<data name="Archive.Log.ReorganizeFilesKept" xml:space="preserve"><value>File names kept, photos changed after the plan: {0}</value><comment>long: job log line; {0} sequence title or folder</comment></data>
<data name="Archive.Log.Reorganized" xml:space="preserve"><value>Sequences changed: {0}, files renamed: {1}</value><comment>long: job log line of a Reorganize; {0} sequences, {1} photos</comment></data>
<data name="Archive.Log.ReorganizedEarlier" xml:space="preserve"><value>The reorganization was completed when the archive was opened</value><comment>long: job log line</comment></data>
<data name="Archive.Log.ReportOnly" xml:space="preserve"><value>Report only: nothing was changed.</value><comment>long: job log line</comment></data>
<data name="Archive.Log.ScanDone" xml:space="preserve"><value>Folders: {0}, indexed: {1}, adopted: {2}, removed: {3}</value><comment>long: job log line</comment></data>
<data name="Archive.Log.SequenceMissing" xml:space="preserve"><value>Sequence not found: {0}</value><comment>long: job log line</comment></data>
@@ -214,6 +220,10 @@
<data name="Archive.Rename.Summary.one" xml:space="preserve"><value>{0:N0} of {1:N0} changes</value></data>
<data name="Archive.Rename.Summary.other" xml:space="preserve"><value>{0:N0} of {1:N0} change</value></data>
<data name="Archive.Rename.Template" xml:space="preserve"><value>Template</value></data>
<data name="Archive.Reorganize.Blocked.InPlace" xml:space="preserve"><value>Photos kept in place outside originals keep their names.</value><comment>long: why photos keep their names in a Reorganize dry run</comment></data>
<data name="Archive.Reorganize.Blocked.Missing" xml:space="preserve"><value>Missing photos keep their names.</value><comment>long: why photos keep their names in a Reorganize dry run</comment></data>
<data name="Archive.Reorganize.Blocked.Unhashed" xml:space="preserve"><value>Photos never verified keep their names; verify the sequence first.</value><comment>long: why photos keep their names in a Reorganize dry run</comment></data>
<data name="Archive.Reorganize.Blocked.Unreadable" xml:space="preserve"><value>The sequence file cannot be read; its photos keep their names.</value><comment>long: why photos keep their names in a Reorganize dry run</comment></data>
<data name="Archive.Retag.Add" xml:space="preserve"><value>Add tags</value></data>
<data name="Archive.Retag.Apply" xml:space="preserve"><value>Apply</value></data>
<data name="Archive.Retag.Heading.one" xml:space="preserve"><value>Tags of {0:N0} sequence</value></data>
+1 -1
View File
@@ -76,7 +76,7 @@
<data name="Jobs.Kind.Import" xml:space="preserve"><value>Import</value></data>
<data name="Jobs.Kind.LightAnalyse" xml:space="preserve"><value>Light analysis</value></data>
<data name="Jobs.Kind.Maintenance" xml:space="preserve"><value>Maintenance</value></data>
<data name="Jobs.Kind.Move" xml:space="preserve"><value>Move archive</value></data>
<data name="Jobs.Kind.Move" xml:space="preserve"><value>Reorganize</value></data>
<data name="Jobs.Kind.Orphans" xml:space="preserve"><value>Orphans</value></data>
<data name="Jobs.Kind.Proxies" xml:space="preserve"><value>Proxies</value></data>
<data name="Jobs.Kind.Rebuild" xml:space="preserve"><value>Rebuild index</value></data>
+2
View File
@@ -70,11 +70,13 @@
<data name="Server.Error.JobUnavailable" xml:space="preserve"><value>This server cannot run that kind of job.</value><comment>long</comment></data>
<data name="Server.Error.LastAdmin" xml:space="preserve"><value>The last administrator cannot be removed or disabled.</value><comment>long</comment></data>
<data name="Server.Error.MethodNotAllowed" xml:space="preserve"><value>This method is not allowed here.</value><comment>long</comment></data>
<data name="Server.Error.NestedTarget" xml:space="preserve"><value>A new folder would lie inside the folder of another sequence.</value><comment>long</comment></data>
<data name="Server.Error.NotFound" xml:space="preserve"><value>Not found.</value><comment>long</comment></data>
<data name="Server.Error.NotChronos" xml:space="preserve"><value>That address is not a Chronos Server.</value><comment>long</comment></data>
<data name="Server.Error.PasswordChangeRequired" xml:space="preserve"><value>Change your password first.</value><comment>long</comment></data>
<data name="Server.Error.PhotoRemoved" xml:space="preserve"><value>The photo was deleted from the sequence while it was being uploaded, so it was not added.</value><comment>long</comment></data>
<data name="Server.Error.PhotoUnreadable" xml:space="preserve"><value>{0} cannot be read, and without its hash other copies would not learn it was deleted; close the program using it or check its permissions, then try again.</value><comment>long</comment></data>
<data name="Server.Error.PlanChanged" xml:space="preserve"><value>The archive changed after the dry run; review the plan again.</value><comment>long</comment></data>
<data name="Server.Error.ProxyUntrusted" xml:space="preserve"><value>This page did not come through a trusted proxy over HTTPS. Open it through your proxy, or add the proxy's address to CHRONOS_TRUSTED_PROXIES.</value><comment>long</comment></data>
<data name="Server.Error.ProxiesDisabled" xml:space="preserve"><value>This archive makes no proxies.</value><comment>long</comment></data>
<data name="Server.Error.ProxyMismatch" xml:space="preserve"><value>The proxy was made from another photo.</value><comment>long</comment></data>