feat: owner review 2 phase 4b: mass conversion after import (#13)
CI / Build and test (push) Failing after 3m1s
CI / PostgreSQL 16 integration (push) Skipped
CI / PostgreSQL 17 integration (push) Skipped
CI / Docker image (push) Skipped
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
Release / Build, test and publish (push) Successful in 15m31s
Release / Server image (push) Successful in 1m13s
CI / Build and test (push) Failing after 3m1s
CI / PostgreSQL 16 integration (push) Skipped
CI / PostgreSQL 17 integration (push) Skipped
CI / Docker image (push) Skipped
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
Release / Build, test and publish (push) Successful in 15m31s
Release / Server image (push) Successful in 1m13s
Convert photos already in the archive to JPEG, TIFF-16 or Linear DNG, from the panel's Library and the desktop's Archive and Library. Each run asks Replace (same frames, originals to the trash, recoverable) or New sequence. A dry run lists what converts, what is skipped and why, size before and after, and free space; the job converts exactly the confirmed photos, resumes, and commits all or nothing per sequence. A conversion never changes what Chronos reads from a photo. Replaced originals are erased only on the archive's own word that their conversion is gone. Desktop TIFFs that WIC showed black or as noise now go to the managed reader; the Edit picker no longer spins a core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #13.
This commit is contained in:
1 parent
7e4a3b481d
commit
efa87f68ce
354 files changed
+24530
-843
No files matched your search
@@ -60,7 +60,46 @@ public sealed class TrashDialogTests(TestContext context)
|
||||
var lines = request.Detail!.Split(Environment.NewLine);
|
||||
Assert.Equal(2, lines.Length);
|
||||
Assert.Contains(Loc.L("Archive.Trash.Kind.Photos"), lines[0]);
|
||||
Assert.False(request.Detail!.Contains(Loc.L("Archive.Trash.ConversionDeleted"), StringComparison.Ordinal), "no conversion was deleted");
|
||||
Assert.Null(TrashEmptyPlans.Request(plan with { Entries = [] }), "nothing to erase: no confirmation");
|
||||
|
||||
// Replaced originals whose conversion was deleted since: the line says so, as the dry run found it.
|
||||
var replaced = Entry("Etna", TrashKind.Replaced, 3, 90_000_000) with { ConversionDeleted = true };
|
||||
var lone = Assert.NotNull(TrashEmptyPlans.Request(plan with { Entries = [replaced] }));
|
||||
Assert.Contains(Loc.L("Archive.Trash.Kind.Replaced") + Loc.Separator + Loc.Plural("Shell.Status.Photos", 3) + Loc.Separator
|
||||
+ Loc.L("Archive.Trash.ConversionDeleted"), lone.Detail!);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EveryEntryThatMayHoldTheLastCopyIsNamedBeforeTheTypedConfirmation()
|
||||
{
|
||||
Loc.SetCulture(CultureInfo.GetCultureInfo("en"));
|
||||
// The trash lists newest first: ten deletions since two old conversions whose converted photos were deleted.
|
||||
var newer = Enumerable.Range(1, 10).Select(i => Entry($"Deleted {i}", TrashKind.Photos, 1, 1_000_000)).ToList();
|
||||
var oldest = new[]
|
||||
{
|
||||
Entry("Etna", TrashKind.Replaced, 3, 90_000_000) with { ConversionDeleted = true },
|
||||
Entry("Stromboli", TrashKind.Replaced, 2, 60_000_000) with { ConversionDeleted = true },
|
||||
};
|
||||
var plan = new TrashEmptyPlan(Guid.CreateVersion7(), [.. newer, .. oldest], 160_000_000, "f1", []);
|
||||
|
||||
var lines = Assert.NotNull(TrashEmptyPlans.Request(plan)).Detail!.Split(Environment.NewLine);
|
||||
|
||||
var why = Loc.Separator + Loc.L("Archive.Trash.ConversionDeleted");
|
||||
Assert.True(lines[0].Contains("Etna", StringComparison.Ordinal) && lines[0].Contains(why, StringComparison.Ordinal), lines[0]);
|
||||
Assert.True(lines[1].Contains("Stromboli", StringComparison.Ordinal) && lines[1].Contains(why, StringComparison.Ordinal), lines[1]);
|
||||
// The other entries fill the lines left, and the rest are counted.
|
||||
Assert.Equal(DeletePlans.ListedLines + 1, lines.Length);
|
||||
Assert.Equal(Loc.Plural("Archive.Delete.More", newer.Count - (DeletePlans.ListedLines - oldest.Length)), lines[^1]);
|
||||
|
||||
// More of them than lines: every one is named all the same.
|
||||
var many = Enumerable.Range(1, DeletePlans.ListedLines + 3).Select(i => Entry($"Converted {i}", TrashKind.Replaced, 1, 1_000_000) with { ConversionDeleted = true })
|
||||
.ToList();
|
||||
lines = Assert.NotNull(TrashEmptyPlans.Request(plan with { Entries = [.. newer, .. many] })).Detail!.Split(Environment.NewLine);
|
||||
Assert.Equal(many.Count + 1, lines.Length);
|
||||
for (var i = 0; i < many.Count; i++)
|
||||
Assert.True(lines[i].StartsWith(many[i].Title + " ", StringComparison.Ordinal) && lines[i].Contains(why, StringComparison.Ordinal), lines[i]);
|
||||
Assert.Equal(Loc.Plural("Archive.Delete.More", newer.Count), lines[^1]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -103,7 +142,8 @@ public sealed class TrashDialogTests(TestContext context)
|
||||
|
||||
// Kept: the confirmation was dismissed, nothing is queued.
|
||||
dialog.EmptyCommand.Execute(null);
|
||||
await UntilAsync(() => asked is not null && !dialog.IsBusy);
|
||||
// Until the command has ended, not only the dialog's work: a command still running ignores the next Execute.
|
||||
await UntilAsync(() => asked is not null && !dialog.IsBusy && dialog.EmptyCommand.CanExecute(null));
|
||||
Assert.Equal("1", asked!.TypedConfirmation);
|
||||
Assert.False(queued.Task.IsCompleted);
|
||||
Assert.False(closed);
|
||||
|
||||
Reference in new issue
Block a user