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>
+1 -1
View File
@@ -138,7 +138,7 @@
<data name="Admin.Job.Kind.Import" xml:space="preserve"><value>Importazione</value></data>
<data name="Admin.Job.Kind.LightAnalyse" xml:space="preserve"><value>Analisi rapida</value></data>
<data name="Admin.Job.Kind.Maintenance" xml:space="preserve"><value>Manutenzione</value></data>
<data name="Admin.Job.Kind.Move" xml:space="preserve"><value>Spostamento</value></data>
<data name="Admin.Job.Kind.Move" xml:space="preserve"><value>Riorganizzazione</value></data>
<data name="Admin.Job.Kind.Orphans" xml:space="preserve"><value>Orfani</value></data>
<data name="Admin.Job.Kind.Proxies" xml:space="preserve"><value>Proxy</value></data>
<data name="Admin.Job.Kind.Rebuild" xml:space="preserve"><value>Ricostruzione</value></data>
+10
View File
@@ -81,6 +81,8 @@
<data name="Archive.Error.NewerFormat" xml:space="preserve"><value>{0} è stato scritto da un Chronos più recente (formato {1}).</value></data>
<data name="Archive.Error.Offline" xml:space="preserve"><value>L'archivio {0} non è raggiungibile.</value></data>
<data name="Archive.Error.ReadOnly" xml:space="preserve"><value>L'archivio {0} è di sola lettura.</value></data>
<data name="Archive.Error.ReorganizeKept.one" xml:space="preserve"><value>{0:N0} sequenza non è stata riorganizzata come previsto: è cambiata dopo il piano.</value></data>
<data name="Archive.Error.ReorganizeKept.other" xml:space="preserve"><value>{0:N0} sequenze non sono state riorganizzate come previsto: sono cambiate dopo il piano.</value></data>
<data name="Archive.Error.SourceChanged" xml:space="preserve"><value>{0} è cambiato dopo la creazione del piano.</value></data>
<data name="Archive.Error.SourceGone" xml:space="preserve"><value>La scheda o cartella {0} non è più disponibile.</value></data>
<data name="Archive.Error.StalePlan" xml:space="preserve"><value>L'archivio è cambiato dopo la creazione del piano.</value></data>
@@ -146,6 +148,10 @@
<data name="Archive.Log.Orphans" xml:space="preserve"><value>Foto non indicizzate: {0}, foto mancanti: {1}</value></data>
<data name="Archive.Log.ProxiesDone" xml:space="preserve"><value>{0}: create {1}, riusate {2}, illeggibili {3}, in attesa {4}</value></data>
<data name="Archive.Log.ProxiesSent" xml:space="preserve"><value>Proxy per il server: {0} inviati, {1} non inviati</value></data>
<data name="Archive.Log.ReorganizeDropped" xml:space="preserve"><value>Lasciata com'era, cambiata dopo il piano: {0}</value></data>
<data name="Archive.Log.ReorganizeFilesKept" xml:space="preserve"><value>Nomi dei file mantenuti, foto cambiate dopo il piano: {0}</value></data>
<data name="Archive.Log.Reorganized" xml:space="preserve"><value>Sequenze cambiate: {0}, file rinominati: {1}</value></data>
<data name="Archive.Log.ReorganizedEarlier" xml:space="preserve"><value>La riorganizzazione è stata completata all'apertura dell'archivio</value></data>
<data name="Archive.Log.ReportOnly" xml:space="preserve"><value>Solo resoconto: nulla è stato modificato.</value></data>
<data name="Archive.Log.ScanDone" xml:space="preserve"><value>Cartelle: {0}, indicizzate: {1}, adottate: {2}, rimosse: {3}</value></data>
<data name="Archive.Log.SequenceMissing" xml:space="preserve"><value>Sequenza non trovata: {0}</value></data>
@@ -208,6 +214,10 @@
<data name="Archive.Rename.Summary.one" xml:space="preserve"><value>{0:N0} di {1:N0} cambia</value></data>
<data name="Archive.Rename.Summary.other" xml:space="preserve"><value>{0:N0} di {1:N0} cambiano</value></data>
<data name="Archive.Rename.Template" xml:space="preserve"><value>Modello</value></data>
<data name="Archive.Reorganize.Blocked.InPlace" xml:space="preserve"><value>Le foto tenute sul posto fuori da originals mantengono il loro nome.</value></data>
<data name="Archive.Reorganize.Blocked.Missing" xml:space="preserve"><value>Le foto mancanti mantengono il loro nome.</value></data>
<data name="Archive.Reorganize.Blocked.Unhashed" xml:space="preserve"><value>Le foto mai verificate mantengono il loro nome; verifica prima la sequenza.</value></data>
<data name="Archive.Reorganize.Blocked.Unreadable" xml:space="preserve"><value>Il file della sequenza non è leggibile; le sue foto mantengono il loro nome.</value></data>
<data name="Archive.Retag.Add" xml:space="preserve"><value>Aggiungi tag</value></data>
<data name="Archive.Retag.Apply" xml:space="preserve"><value>Applica</value></data>
<data name="Archive.Retag.Heading.one" xml:space="preserve"><value>Tag di {0:N0} sequenza</value></data>
+1 -1
View File
@@ -76,7 +76,7 @@
<data name="Jobs.Kind.Import" xml:space="preserve"><value>Importazione</value></data>
<data name="Jobs.Kind.LightAnalyse" xml:space="preserve"><value>Analisi rapida</value></data>
<data name="Jobs.Kind.Maintenance" xml:space="preserve"><value>Manutenzione</value></data>
<data name="Jobs.Kind.Move" xml:space="preserve"><value>Spostamento archivio</value></data>
<data name="Jobs.Kind.Move" xml:space="preserve"><value>Riorganizzazione</value></data>
<data name="Jobs.Kind.Orphans" xml:space="preserve"><value>File orfani</value></data>
<data name="Jobs.Kind.Proxies" xml:space="preserve"><value>Proxy</value></data>
<data name="Jobs.Kind.Rebuild" xml:space="preserve"><value>Ricostruzione indice</value></data>
+2
View File
@@ -68,11 +68,13 @@
<data name="Server.Error.JobUnavailable" xml:space="preserve"><value>Questo server non può eseguire quel tipo di job.</value></data>
<data name="Server.Error.LastAdmin" xml:space="preserve"><value>L'ultimo amministratore non può essere rimosso o disattivato.</value></data>
<data name="Server.Error.MethodNotAllowed" xml:space="preserve"><value>Metodo non consentito qui.</value></data>
<data name="Server.Error.NestedTarget" xml:space="preserve"><value>Una nuova cartella finirebbe dentro la cartella di un'altra sequenza.</value></data>
<data name="Server.Error.NotFound" xml:space="preserve"><value>Non trovato.</value></data>
<data name="Server.Error.NotChronos" xml:space="preserve"><value>Questo indirizzo non è un Chronos Server.</value></data>
<data name="Server.Error.PasswordChangeRequired" xml:space="preserve"><value>Cambia prima la password.</value></data>
<data name="Server.Error.PhotoRemoved" xml:space="preserve"><value>La foto è stata eliminata dalla sequenza mentre veniva caricata, quindi non è stata aggiunta.</value><comment>long</comment></data>
<data name="Server.Error.PhotoUnreadable" xml:space="preserve"><value>Impossibile leggere {0}: senza il suo hash le altre copie non saprebbero che è stato eliminato. Chiudi il programma che lo usa o controlla i permessi, poi riprova.</value></data>
<data name="Server.Error.PlanChanged" xml:space="preserve"><value>L'archivio è cambiato dopo la simulazione; rivedi di nuovo il piano.</value></data>
<data name="Server.Error.ProxyUntrusted" xml:space="preserve"><value>Questa pagina non è arrivata da un proxy attendibile in HTTPS. Aprila tramite il proxy o aggiungi l'indirizzo del proxy a CHRONOS_TRUSTED_PROXIES.</value></data>
<data name="Server.Error.ProxiesDisabled" xml:space="preserve"><value>Questo archivio non crea proxy.</value></data>
<data name="Server.Error.ProxyMismatch" xml:space="preserve"><value>Il proxy è stato creato da un'altra foto.</value></data>