feat(archive): photo delete, tombstones, trash kinds and emptying, library API

Owner review 2, R6: the web panel manages the library without editing it, so
the engine and the server must delete single photos safely, keep them out of
sync afterwards, and let an administrator restore or finally erase the trash.

- Migration 0008: frame_removals (tombstones by sequence and SHA-256, reason,
  replacement); the sidecar gains "removed" (omitted when empty) and frames a
  reserved "source"; the indexer writes the tombstones on every sync, so a
  rebuild keeps them, and drops a hero frame that is gone.
- FrameTrash: dry run (busy, frames changed, offline, would empty), delete under
  the sequence lease with a write-ahead journal that the next writer undoes
  after a crash, files to trash/photos/<seq>-<time>/originals with a record,
  sidecar without the frames plus tombstones, index sync clearing analyses,
  thumbnails and proxies, proxies renamed to follow their frames, follow-up
  jobs. Restore re-hashes every file, keeps mismatches in the trash, puts the
  same frame records back and drops their tombstones, or files the photos into
  a new sequence through the ingest when theirs is gone.
- Project positions on vanished photos are translated by photo and wait as
  pending frames, so they come back with a restore.
- Trash entries have a kind (sequence, photos, replaced); emptying is a dry run
  with a fingerprint and a new EmptyTrash job (18) that erases exactly the
  planned entries, refuses a stale plan and erases replaced originals only
  while their replacements still hash right.
- Sync honours tombstones: nothing one side deleted is offered back, local
  files are never deleted, replaced photos count as their replacement; the
  server answers an upload of a tombstoned SHA-256 as already there.
- Server: sequence thumbnail, photo delete, bulk delete/retag/jobs, trash
  list/restore/empty endpoints with their error messages; a verify of
  sequences now targets their archive (POST /jobs failed before).
- Desktop trash dialog lists photo entries and empties the trash after a
  typed confirmation through the same job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 35bb56690a1d69eae57153d036e1409201cd73f7)
This commit is contained in:
Alby96 committed 2026-10-27 10:49:34 +01:00
1 parent 4b9ba04fe4
commit 51782a3ada
63 files changed
+3303 -60

No files matched your search

+20 -1
View File
@@ -89,6 +89,10 @@
<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>
<data name="Archive.Error.TrashChanged" xml:space="preserve"><value>The trash changed after it was checked; nothing was erased.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.TrashKept.one" xml:space="preserve"><value>{0:N0} trash entry was kept: it changed, or a replacement no longer matches.</value><comment>long: error sentence of an emptying job</comment></data>
<data name="Archive.Error.TrashKept.other" xml:space="preserve"><value>{0:N0} trash entries were kept: they changed, or a replacement no longer matches.</value><comment>long: error sentence of an emptying job</comment></data>
<data name="Archive.Error.TrashMismatch" xml:space="preserve"><value>No file of this trash entry matches its record any more; it stays in the trash.</value><comment>long: error sentence</comment></data>
<data name="Archive.Failed.Access" xml:space="preserve"><value>Chronos was denied access to the archive.</value><comment>long</comment></data>
<data name="Archive.Failed.Files" xml:space="preserve"><value>A file of the archive could not be read or written.</value><comment>long</comment></data>
<data name="Archive.Failed.Gone" xml:space="preserve"><value>The sequence is no longer in the index.</value><comment>long</comment></data>
@@ -152,7 +156,9 @@
<data name="Archive.Log.SequenceMissing" xml:space="preserve"><value>Sequence not found: {0}</value><comment>long: job log line</comment></data>
<data name="Archive.Log.StepFailed" xml:space="preserve"><value>Clean-up step {0} failed: {1}</value><comment>long: job log line; {0} step name (job-history, audit…); {1} error message</comment></data>
<data name="Archive.Log.StepUnknown" xml:space="preserve"><value>Clean-up step unknown here: {0}</value><comment>long: job log line; {0} step name</comment></data>
<data name="Archive.Log.TrashEmptied" xml:space="preserve"><value>Entries erased: {0}, size: {1}</value><comment>long: job log line; {0} count; {1} size</comment></data>
<data name="Archive.Log.TrashEntry" xml:space="preserve"><value>In the trash since {0}: {1} ({2})</value><comment>long: job log line; {0} date; {1} sequence title; {2} size</comment></data>
<data name="Archive.Log.TrashKept" xml:space="preserve"><value>Kept in the trash: {0}</value><comment>long: job log line; {0} sequence title</comment></data>
<data name="Archive.Log.TrashOffline" xml:space="preserve"><value>Trash not checked: the archive cannot be reached</value><comment>long: job log line</comment></data>
<data name="Archive.Log.TrashReport" xml:space="preserve"><value>Old trash entries: {0}, size: {1}; nothing was deleted</value><comment>long: job log line; entries older than the clean-up's age limit</comment></data>
<data name="Archive.Log.VerifyDone" xml:space="preserve"><value>Photos checked: {0}, intact: {1}, hashed: {2}, with problems: {3}</value><comment>long: job log line</comment></data>
@@ -248,11 +254,24 @@
<data name="Archive.Toolbar.Rebuild" xml:space="preserve"><value>Rebuild index…</value></data>
<data name="Archive.Toolbar.Scan" xml:space="preserve"><value>Scan</value></data>
<data name="Archive.Toolbar.Verify" xml:space="preserve"><value>Verify</value></data>
<data name="Archive.Trash.Checking" xml:space="preserve"><value>Checking the trash…</value></data>
<data name="Archive.Trash.Deleted" xml:space="preserve"><value>Deleted {0}</value><comment>long</comment></data>
<data name="Archive.Trash.Empty" xml:space="preserve"><value>The trash is empty</value><comment>long</comment></data>
<data name="Archive.Trash.EmptyAction" xml:space="preserve"><value>Empty…</value></data>
<data name="Archive.Trash.EmptyHeading.one" xml:space="preserve"><value>Erase {0:N0} trash entry for good?</value><comment>long</comment></data>
<data name="Archive.Trash.EmptyHeading.other" xml:space="preserve"><value>Erase {0:N0} trash entries for good?</value><comment>long</comment></data>
<data name="Archive.Trash.EmptyMessage" xml:space="preserve"><value>{0} and {1} ({2}) are erased from the archive; this cannot be undone.</value><comment>long</comment></data>
<data name="Archive.Trash.Entries.one" xml:space="preserve"><value>{0:N0} entry</value></data>
<data name="Archive.Trash.Entries.other" xml:space="preserve"><value>{0:N0} entries</value></data>
<data name="Archive.Trash.Erase" xml:space="preserve"><value>Erase for good</value></data>
<data name="Archive.Trash.Failed" xml:space="preserve"><value>The sequence could not come back from the trash</value><comment>long</comment></data>
<data name="Archive.Trash.Heading" xml:space="preserve"><value>Trash · {0}</value><comment>long</comment></data>
<data name="Archive.Trash.List" xml:space="preserve"><value>Deleted sequences</value></data>
<data name="Archive.Trash.KeptFiles.one" xml:space="preserve"><value>{0:N0} file stayed in the trash: it no longer matches its record.</value><comment>long</comment></data>
<data name="Archive.Trash.KeptFiles.other" xml:space="preserve"><value>{0:N0} files stayed in the trash: they no longer match their record.</value><comment>long</comment></data>
<data name="Archive.Trash.Kind.Photos" xml:space="preserve"><value>Photos</value></data>
<data name="Archive.Trash.Kind.Replaced" xml:space="preserve"><value>Replaced originals</value></data>
<data name="Archive.Trash.Kind.Sequence" xml:space="preserve"><value>Sequence</value></data>
<data name="Archive.Trash.List" xml:space="preserve"><value>Trash entries</value></data>
<data name="Archive.Trash.Reading" xml:space="preserve"><value>Reading the trash…</value></data>
<data name="Archive.Trash.Restore" xml:space="preserve"><value>Restore</value></data>
<data name="Archive.Trash.Restored.one" xml:space="preserve"><value>{0:N0} sequence restored</value><comment>long</comment></data>