fix: conversions name, lock and settle as phase 4a's writers do
Phase 4b was built on phase 4a before its review fixes. Integrated on the reviewed 4a, the
conversion now follows the same rules as filing and the other writers.
- Names: a converted file is named as filing names a photo of its sequence (FrameNaming: the
archive's file template, the frame's context in the sequence with its camera, lens, number
and title, {name} the card's, {ext} the target's, a long name keeping its extension).
Replace through ConvertOptions.FileName; New sequence through the ingest itself
(StagedFrame.NamedAs), which numbers and names the copies in the new sequence. Names stay
unique against every file present, those leaving included, so a Replace never moves onto a
file; a test pins a stray file that keeps its bytes.
- Leases: stage A starts from the sidecar settled under the sequence's lease where the index
has it then (SequenceWriter.ReadLocked), and FrameTrash.ReplaceAsync reads the row again
under the lease, so a folder a Reorganize moved meanwhile is followed, never made again.
A Reorganize the archive waits for keeps the conversion off its sequences (pinned).
- Journals: the replace journal is settled with the others. MassRenamer steps, restores into
a sequence and sequence deletions wait for an unsettled replacement as they wait for a
restore, and so do photo deletions, whose frames version the recovery reads
(FrameTrash.EnsureReplaced); a scan settles it and reconciles nothing meanwhile; a restore
settles its sequence's replace journal first, at the folder the index has under the lease.
- The convert job tells each sequence converted or made as it completes, as a Reorganize
tells each step, so an editor open on it reads it again while the rest of the job runs.
- Desktop: JobKind.Convert gets its row in the settings' job priority list. A click on Apply
that commits the quality no longer starts the same dry run again under the click (as 4a
fixed for Reorganize).
- Panel: a dry run answered during the confirmation with the same plan no longer drops the
confirmed Apply; a different plan is shown with Admin.Convert.PlanChanged (en, it).
- Tests: TrashDialogTests.EmptyQueuesTheJobOfTheConfirmedPlanOnly waits for the command to
end before running it again (a running AsyncRelayCommand ignored the second Execute).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2e0d1d6dcc10575734970bb9c77749f00777c859)
This commit is contained in:
1 parent
a1c1c21ebd
commit
341fb77507
22 files changed
+345
-91
No files matched your search
@@ -55,7 +55,7 @@ public sealed class ConvertDialogViewModel : ArchiveDialogViewModel
|
||||
_confirm = confirm;
|
||||
// Only a JPEG has a quality: for the other formats the field neither counts nor blocks.
|
||||
Quality = new EditableField(ConvertOptions.DefaultQuality.ToString(Loc.Culture), t => _target == ConvertTarget.Jpeg ? ConvertPlans.ValidateQuality(t) : null,
|
||||
committed => _ = PlanAsync(), () => Loc.L("Tooltips.Archive.ConvertQuality"));
|
||||
_ => OnCommitted(), () => Loc.L("Tooltips.Archive.ConvertQuality"));
|
||||
Quality.PropertyChanged += (_, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(EditableField.Text)) OnTyped();
|
||||
@@ -251,6 +251,23 @@ public sealed class ConvertDialogViewModel : ArchiveDialogViewModel
|
||||
_delay.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enter, or the focus leaving the quality, plans at once, unless the dry run on screen or the one under way is already of
|
||||
/// these options: a click on Apply takes the focus from the field first, and an identical dry run started then would turn
|
||||
/// Apply off under the click.
|
||||
/// </summary>
|
||||
private void OnCommitted()
|
||||
{
|
||||
if (IsPlanned()) _delay.Stop();
|
||||
else _ = PlanAsync();
|
||||
}
|
||||
|
||||
/// <summary>The options on screen have their plan, or a dry run of them is under way; false after a failed one.</summary>
|
||||
private bool IsPlanned()
|
||||
{
|
||||
lock (_gate) return _run.For is { } options && options == Current() && (_run.Plan is not null || _planning is not null);
|
||||
}
|
||||
|
||||
private async Task DryRunAsync()
|
||||
{
|
||||
var options = Current();
|
||||
|
||||
Reference in new issue
Block a user