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:
1 parent
5b5acaf307
commit
c669d0504d
25 files changed
+1307
-226
No files matched your search
@@ -133,11 +133,14 @@ public sealed record ReorganizePlanDto(IReadOnlyList<ReorganizeStepDto> Steps, i
|
||||
/// become the frames, the originals go to the archive's trash) or <c>new-sequence</c> (copies in a new sequence, the source
|
||||
/// untouched, the photos it leaves as they are not copied into it). <see cref="DryRun"/> answers the plan
|
||||
/// (<see cref="ConvertPlanDto"/>) and changes nothing; the server keeps it a few minutes, a refusal too, so the same dry run
|
||||
/// again (also after one cut off, in either mode, at any quality of a lossless target) is answered from it with the free
|
||||
/// space measured again; 503 <c>plan_dropped</c> when the server stopped making it (it took too long, or too many were
|
||||
/// asked at once). The change itself sends that plan's <see cref="Fingerprint"/> back (409 <c>plan_changed</c> when the
|
||||
/// index changed since in what the plan reads: the sequences' rows, and the formats, sizes, hashes and flags of their
|
||||
/// photos) and runs as a <c>convert</c> job (202), which plans again and leaves as it is a sequence that no longer fits.
|
||||
/// again (also after one cut off, in either mode, at any quality of a lossless target) is answered from it with the busy
|
||||
/// sequences and the free space as they are then; 503 <c>plan_dropped</c> when the server stopped making it (it took too
|
||||
/// long, or too many were asked at once). The change itself sends that plan's <see cref="Fingerprint"/> back and takes the
|
||||
/// plan kept (503 <c>plan_dropped</c> when none is kept for the index as it is now, let go since or the index changed in
|
||||
/// what the plan reads, the sequences' rows and the formats, sizes, hashes and flags of their photos: ask the dry run
|
||||
/// again, then confirm that one; 409 <c>plan_changed</c> when the plan kept is not the one confirmed: a job made one of its
|
||||
/// sequences busy or free since, or a conversion of them was queued) and runs as a <c>convert</c> job (202), which
|
||||
/// converts the photos of that plan alone and leaves as it is a sequence where one of them no longer fits.
|
||||
/// </summary>
|
||||
public sealed record ConvertRequest(IReadOnlyList<Guid>? SequenceIds, bool All, string? Target, int? Quality, string? Mode, bool DryRun,
|
||||
string? Fingerprint = null);
|
||||
@@ -146,9 +149,10 @@ public sealed record ConvertRequest(IReadOnlyList<Guid>? SequenceIds, bool All,
|
||||
/// Photos of a sequence a conversion leaves as they are: <see cref="Reason"/> <c>same_format</c>, <c>convert_on_pc</c> (the
|
||||
/// server cannot read them at full resolution: a CR3, a HEIC, a body its RAW decoder does not support), <c>undecodable</c>,
|
||||
/// <c>missing</c>, <c>unhashed</c> (never verified), <c>eight_bit</c> (a RAW the host develops at 8 bits only, for a 16-bit
|
||||
/// target), <c>color_profile</c> (a colour profile the target can neither keep nor convert to) or <c>too_large</c>, how
|
||||
/// many, and the reason as one localised sentence: with <c>new-sequence</c>, that the new sequence lacks them (it holds the
|
||||
/// converted copies alone).
|
||||
/// target), <c>color_profile</c> (a colour profile the target can neither keep nor convert to), <c>too_large</c> or
|
||||
/// <c>inaccessible</c> (another program held the file open, or it could not be opened, when the plan was made), how many,
|
||||
/// and the reason as one localised sentence: of a sequence <c>new-sequence</c> copies, that the new sequence lacks them (it
|
||||
/// holds the converted copies alone).
|
||||
/// </summary>
|
||||
public sealed record ConvertSkippedDto(string Reason, int Photos, string Message);
|
||||
|
||||
|
||||
Reference in new issue
Block a user