fix(convert): the job converts exactly the photos its preview listed, once

A conversion job could still do something its confirmed dry run did not show,
or refuse what it should have converted:

- An upload landing between the confirmation and the sequence's turn made the
  sequence Changed at every retry. Each ConvertSequence now names the photos
  the plan converts (Photos, their frame ids); the job takes those from its
  re-plan, checks their content against the confirmed digest and leaves photos
  that came in since as they are. A photo the plan did not list is never
  converted, whatever changed on disk or in the index since the dry run.
- A file another program held during the dry run was planned as Missing and
  then converted or not depending on the re-plan. It is now its own reason
  (inaccessible, "held open or cannot be opened"); a truncated file reads as
  undecodable. At job time a confirmed photo that cannot be opened leaves the
  sequence Blocked for the retry; a held photo the job does not convert does
  not hide a real change.
- The same sequences could be converted twice (two dialogs or tabs, a lost
  answer, no dry run at all). MassConverter.QueueAsync checks the queued,
  running and paused conversions and queues under one lock, in the caller's
  context (the desktop's enqueue shows a toast on the UI thread); a job's own
  re-plan treats sequences of conversions queued before it as busy.
- The per-photo space check reserved a full batch of photos even when fewer
  were left, so a job whose preview had the space could stop at every retry.
  It now reserves the photo and those after it that may convert at once.
- New sequence now says in the dry run, the panel's totals and confirmation,
  and a new desktop confirmation, how many photos each new sequence lacks;
  only sequences that are copied use those words.
- On the server, a confirmation takes only the plan kept for the index as it
  is now (503 plan_dropped otherwise, never a plan made inside the request),
  and busy sequences and free space are as they are at every request. The
  panel's Apply asks the dry run again first, with Close still available,
  and confirms only the same fingerprint.
- Maintenance keeps another host's conversion staging as long as its journal
  and purges both together; the unstaged-copy failure and blocked sequences
  are logged in catalog sentences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit fefd9c34ebfeed1f9e84161610ef286026d38355)
This commit is contained in:
Alby96 committed 2026-11-02 10:33:34 +01:00
1 parent 5b5acaf307
commit c669d0504d
25 files changed
+1307 -226

No files matched your search

+3
View File
@@ -123,12 +123,15 @@
<data name="Admin.Convert.Mode.Replace.Tip" xml:space="preserve"><value>The converted files become the sequence's photos; the originals go to the archive's trash, restorable until it is emptied</value></data>
<data name="Admin.Convert.NoAnswer" xml:space="preserve"><value>The server did not answer: check on the Jobs page whether the conversion was queued before converting again.</value><comment>long</comment></data>
<data name="Admin.Convert.NoSpace.Tip" xml:space="preserve"><value>Free some space on the archive's volume first</value></data>
<data name="Admin.Convert.NotCopiedCount.one" xml:space="preserve"><value>{0} not copied</value><comment>a photo count a new sequence lacks</comment></data>
<data name="Admin.Convert.NotCopiedCount.other" xml:space="preserve"><value>{0} not copied</value><comment>a photo count a new sequence lacks</comment></data>
<data name="Admin.Convert.Nothing.Tip" xml:space="preserve"><value>Nothing in the preview converts</value></data>
<data name="Admin.Convert.NothingToConvert" xml:space="preserve"><value>Nothing to convert: every photo stays as it is, for the reasons shown.</value><comment>long</comment></data>
<data name="Admin.Convert.OpenJob" xml:space="preserve"><value>Open job</value></data>
<data name="Admin.Convert.OpenJob.Tip" xml:space="preserve"><value>Show the job and its log on the Jobs page</value></data>
<data name="Admin.Convert.PlanItem" xml:space="preserve"><value>{0} · {1} · {2}</value><comment>invariant; a sequence's title, the photos it converts, and their size before and after</comment></data>
<data name="Admin.Convert.PlanChanged" xml:space="preserve"><value>The archive changed since the preview; check the new one and apply again.</value><comment>long</comment></data>
<data name="Admin.Convert.PlanItemNotCopied" xml:space="preserve"><value>{0} · {1}</value><comment>invariant; a sequence of the New sequence confirmation (Admin.Convert.PlanItem), then the photos its new sequence lacks</comment></data>
<data name="Admin.Convert.Planning" xml:space="preserve"><value>Planning…</value></data>
<data name="Admin.Convert.Planning.Tip" xml:space="preserve"><value>The server reads every photo folder of the selection: a large archive takes minutes, and the preview appears once it is done</value></data>
<data name="Admin.Convert.PlanningFor" xml:space="preserve"><value>Planning… {0}</value><comment>{0} how long the dry run has taken so far, e.g. "2 min"</comment></data>