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
@@ -84,7 +84,8 @@ public sealed class SyncRulesTests
|
||||
|
||||
// A photo replaced by a converted file on either side is the same photo as its replacement, and so is a chain of them.
|
||||
var replaced = new SyncTombstones([], [new RemovedPhotoDto("aa", "a2", "replaced", at), new RemovedPhotoDto("a2", "a3", "replaced", at)]);
|
||||
Assert.Equal("a3", replaced.Canonical("AA"));
|
||||
Assert.Equal(replaced.Canonical("a3"), replaced.Canonical("AA"));
|
||||
Assert.Equal(replaced.Canonical("a3"), replaced.Canonical("a2"));
|
||||
Assert.Equal((0, 0), SyncRules.CompareOriginals([Photo("aa"), Photo("bb")], [Photo("a3"), Photo("bb")], replaced));
|
||||
Assert.False(replaced.DeletedRemotely("aa"), "a replaced photo is there as its replacement");
|
||||
var replacedHere = new SyncTombstones([new FrameRemoval(localId, "bb", "b2", RemovalReason.Replaced, at)], null);
|
||||
@@ -97,6 +98,43 @@ public sealed class SyncRulesTests
|
||||
new FrameRemoval(localId, "bb", "b2", RemovalReason.Replaced, at)]).Select(r => r.Reason));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void APhotoEachSideConvertedOnItsOwnIsStillOnePhoto()
|
||||
{
|
||||
static FramePhoto Photo(string sha) => new(sha, 100, null);
|
||||
var at = new DateTimeOffset(2026, 10, 27, 10, 0, 0, TimeSpan.Zero);
|
||||
var localId = Guid.CreateVersion7();
|
||||
// This PC converted "oo" to "aa", the server converted its copy to "bb" (another decoder, other bytes).
|
||||
var both = new SyncTombstones([new FrameRemoval(localId, "OO", "aa", RemovalReason.Replaced, at)], [new RemovedPhotoDto("oo", "BB", "replaced", at)]);
|
||||
Assert.Equal(both.Canonical("oo"), both.Canonical("aa"));
|
||||
Assert.Equal(both.Canonical("oo"), both.Canonical("bb"));
|
||||
Assert.Equal((0, 0), SyncRules.CompareOriginals([Photo("aa"), Photo("cc")], [Photo("bb"), Photo("cc")], both));
|
||||
// The same whichever side's links come first, and with an undo (a link back) in the chain.
|
||||
var reversed = new SyncTombstones([new FrameRemoval(localId, "bb", "oo", RemovalReason.Replaced, at)], [new RemovedPhotoDto("aa", "oo", "replaced", at)]);
|
||||
Assert.Equal(both.Canonical("aa"), reversed.Canonical("bb"));
|
||||
Assert.Equal("cc", both.Canonical("CC"));
|
||||
// A deletion covers every encoding of the photo: the server deleted its conversion, so this PC's is not sent.
|
||||
var deleted = new SyncTombstones([new FrameRemoval(localId, "oo", "aa", RemovalReason.Replaced, at)],
|
||||
[new RemovedPhotoDto("oo", "bb", "replaced", at), new RemovedPhotoDto("bb", null, "deleted", at)]);
|
||||
Assert.True(deleted.DeletedRemotely("aa"));
|
||||
Assert.False(deleted.DeletedLocally("bb"));
|
||||
Assert.False(both.DeletedRemotely("aa"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AProxyIsMadeFromThePhotoThisPcConverted()
|
||||
{
|
||||
var heif = new ImageDecoder([new NativeHeif()]);
|
||||
var at = new DateTimeOffset(2026, 10, 27, 10, 0, 0, TimeSpan.Zero);
|
||||
// The server holds the HEIC original "oo" and cannot decode it; this PC converted its copy to a JPEG ("dd").
|
||||
List<Frame> local = [Original("dd", 100, ImageFileFormat.Jpeg)];
|
||||
var manifest = new SequenceManifest(Guid.CreateVersion7(), 1, 1, null, [], [Wanted("oo", 500, "IMG_0001.HEIC")], [], new ProxySpec(1920, 90));
|
||||
var tombstones = new SyncTombstones([new FrameRemoval(Local.Id, "oo", "dd", RemovalReason.Replaced, at)], null);
|
||||
|
||||
Assert.Equal(1, SyncRules.ProxiesToSend(manifest, local, heif, null, tombstones));
|
||||
Assert.Equal(0, SyncRules.ProxiesToSend(manifest, local, heif));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ATombstoneBesideAPhotoItsSideStillHoldsHidesNothing()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user