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>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>