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
@@ -143,6 +143,46 @@ public sealed class LibraryPagerTests
|
||||
}
|
||||
|
||||
/// <summary>An in-memory library: cursors are offsets, optionally held back by a gate.</summary>
|
||||
[Test]
|
||||
public async Task APageInFlightIsWaitedForNotAskedForAgain()
|
||||
{
|
||||
// The Edit picker reads on until a sequence is listed; the list may ask for a page as it scrolls meanwhile.
|
||||
var source = new FakeSource(30);
|
||||
var pager = new LibraryPager(source.FetchAsync, pageSize: 10);
|
||||
await pager.ResetAsync(new LibraryFilter());
|
||||
Assert.True(pager.WhenLoadedAsync().IsCompleted, "nothing is loading");
|
||||
|
||||
source.Gate = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
var scrolled = pager.LoadMoreAsync();
|
||||
var again = pager.LoadMoreAsync();
|
||||
Assert.True(again.IsCompletedSuccessfully && again.Result is null, "asking again gets nothing at once");
|
||||
var loaded = pager.WhenLoadedAsync();
|
||||
Assert.False(loaded.IsCompleted, "the page in flight is waited for");
|
||||
|
||||
source.Gate.SetResult();
|
||||
await loaded;
|
||||
Assert.True(scrolled.IsCompleted, "the wait ends with that page");
|
||||
Assert.Equal(10, Assert.NotNull(await scrolled).Items.Count);
|
||||
Assert.Equal(2, source.Queries.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task WaitingForAPageThatFailsDoesNotFail()
|
||||
{
|
||||
var source = new FakeSource(30);
|
||||
var pager = new LibraryPager(source.FetchAsync, pageSize: 10);
|
||||
await pager.ResetAsync(new LibraryFilter());
|
||||
source.Gate = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
source.Fail = true;
|
||||
var page = pager.LoadMoreAsync();
|
||||
var loaded = pager.WhenLoadedAsync();
|
||||
|
||||
source.Gate.SetResult();
|
||||
await loaded;
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => page);
|
||||
Assert.False(pager.HasMore, "a failing page stops the reading");
|
||||
}
|
||||
|
||||
private sealed class FakeSource(int count)
|
||||
{
|
||||
private readonly Guid _archive = Guid.CreateVersion7();
|
||||
|
||||
@@ -65,7 +65,10 @@ public sealed class MassActionsTests
|
||||
var remote = Remote("Sunrise over Superga");
|
||||
SelectedSequence[] mixed = [harbour, remote];
|
||||
|
||||
foreach (var action in new[] { MassAction.Analyse, MassAction.Proxies, MassAction.Verify, MassAction.Tag, MassAction.Rate, MassAction.Reorganize, MassAction.Delete })
|
||||
foreach (var action in new[]
|
||||
{
|
||||
MassAction.Analyse, MassAction.Proxies, MassAction.Verify, MassAction.Tag, MassAction.Rate, MassAction.Reorganize, MassAction.Convert, MassAction.Delete,
|
||||
})
|
||||
{
|
||||
Assert.Null(MassActions.Blocker(action, mixed, SignedIn), action.ToString());
|
||||
Assert.SequenceEqual([harbour], MassActions.Targets(action, mixed, SignedIn), action.ToString());
|
||||
@@ -93,6 +96,25 @@ public sealed class MassActionsTests
|
||||
Assert.Equal(Loc.Plural("Tooltips.Library.Mass.Reorganize", 2), MassActions.ToolTip(MassAction.Reorganize, 2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertStaysInsideOneArchive()
|
||||
{
|
||||
SelectedSequence[] two = [Only("Harbour sunset"), new(Local("Aurora", Guid.CreateVersion7()), null)];
|
||||
Assert.Equal(Loc.L("Library.Blocked.OneArchiveConvert"), MassActions.Blocker(MassAction.Convert, two, Offline), "one plan and one job per archive");
|
||||
Assert.Equal(Loc.L("Library.Blocked.OneArchive"), MassActions.Blocker(MassAction.Reorganize, two, Offline), "each says which action it is");
|
||||
|
||||
// A server card is left out: the photos converted are those on this PC.
|
||||
var remote = Remote("Sunrise over Superga");
|
||||
SelectedSequence[] withCard = [two[0], Only("Comet"), remote];
|
||||
Assert.Null(MassActions.Blocker(MassAction.Convert, withCard, SignedIn));
|
||||
Assert.SequenceEqual(withCard[..2], MassActions.Targets(MassAction.Convert, withCard, SignedIn));
|
||||
Assert.Equal(Loc.L("Library.Blocked.ServerOnly"), MassActions.Blocker(MassAction.Convert, [remote], SignedIn));
|
||||
Assert.Equal(Loc.L("Library.Blocked.NoIndex"), MassActions.Blocker(MassAction.Convert, [two[0]], new SelectionContext(HasEngine: false, IsSignedIn: false, default)),
|
||||
"the dry run and the job need the engine");
|
||||
Assert.Equal(Loc.L("Library.Blocked.NoSelection"), MassActions.Blocker(MassAction.Convert, [], SignedIn));
|
||||
Assert.Equal(Loc.Plural("Tooltips.Library.Mass.Convert", 2), MassActions.ToolTip(MassAction.Convert, 2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TransfersNeedASessionAndTheRight()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user