feat: owner review 2 phase 3: Library on the web panel, photo trash and web upload (#11)
CI / Build and test (push) Successful in 7m25s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
CI / PostgreSQL 16 integration (push) Successful in 5m20s
CI / PostgreSQL 17 integration (push) Successful in 5m22s
CI / Docker image (push) Successful in 50s
Release / Build, test and publish (push) Successful in 12m1s
Release / Server image (push) Successful in 1m26s
CI / Build and test (push) Successful in 7m25s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 10s
CI / PostgreSQL 16 integration (push) Successful in 5m20s
CI / PostgreSQL 17 integration (push) Successful in 5m22s
CI / Docker image (push) Successful in 50s
Release / Build, test and publish (push) Successful in 12m1s
Release / Server image (push) Successful in 1m26s
- Web panel Library: browse, view, delete sequences and photos, mass operations (analyse, proxies, thumbnails, verify, retag, delete, CSV). It never edits the video. - Photo trash with tombstones (migration 0008): crash-safe delete and restore, hash-checked restore with reasons, and emptying only by an explicit fingerprinted job. Sync and uploads keep deleted photos deleted; an explicit "Upload again" brings one back. - Upload from the web panel: in-house SHA-256 in a worker with a fail-closed self-test, capture time from EXIF, chunked, resumable; no folders. - Desktop trash dialog with photo entries and Empty. - Admin files are revalidated (no-cache + ETag). 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 #11.
This commit is contained in:
1 parent
af9eeaab9b
commit
9aa818ed47
283 files changed
+24922
-293
No files matched your search
@@ -58,6 +58,43 @@ public sealed class ManifestStoreTests(TestContext context)
|
||||
Assert.Contains(field, json);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TombstonesAndConversionSourcesRoundTripWhileASidecarWithoutThemStaysAsItWas()
|
||||
{
|
||||
var path = SidecarPath();
|
||||
var plain = Sample();
|
||||
ManifestStore.WriteSequence(path, plain);
|
||||
var before = File.ReadAllText(path);
|
||||
Assert.False(before.Contains("\"removed\"", StringComparison.Ordinal), "no tombstones, no field");
|
||||
Assert.False(before.Contains("\"source\"", StringComparison.Ordinal), "an original has no source");
|
||||
|
||||
var at = new DateTimeOffset(2026, 10, 27, 10, 0, 0, TimeSpan.Zero);
|
||||
var changed = plain with
|
||||
{
|
||||
Removed =
|
||||
[
|
||||
new RemovedPhoto { Sha256 = new string('b', 64), Reason = RemovalReason.Deleted, At = at },
|
||||
new RemovedPhoto { Sha256 = new string('c', 64), Replacement = new string('d', 64), Reason = RemovalReason.Replaced, At = at },
|
||||
],
|
||||
Frames =
|
||||
[
|
||||
plain.Frames[0] with
|
||||
{
|
||||
Source = new FrameSource { Sha256 = new string('e', 64), Format = ImageFileFormat.Cr2, File = "originals/IMG_0001.CR2", Size = 25_000_000 },
|
||||
},
|
||||
],
|
||||
};
|
||||
ManifestStore.WriteSequence(path, changed);
|
||||
var read = ManifestStore.ReadSequence(path);
|
||||
|
||||
Assert.Equal(Canonical(changed), Canonical(read));
|
||||
Assert.Equal(RemovalReason.Replaced, Assert.NotNull(read.Removed)[1].Reason);
|
||||
Assert.Equal(new string('d', 64), read.Removed[1].Replacement);
|
||||
Assert.Equal(ImageFileFormat.Cr2, Assert.NotNull(read.Frames[0].Source).Format);
|
||||
var json = File.ReadAllText(path);
|
||||
foreach (var field in new[] { "\"removed\":", "\"replacement\":", "\"reason\":\"Replaced\"", "\"at\":", "\"source\":" }) Assert.Contains(field, json);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ASidecarBeingReadIsReplacedOnceTheReaderIsDone()
|
||||
{
|
||||
|
||||
@@ -36,6 +36,41 @@ public sealed class ThumbPackTests(TestContext context)
|
||||
Assert.Null(reader.Read(100));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RekeyingMovesThumbnailsToTheirFramesNewIndexWithoutCopyingThem()
|
||||
{
|
||||
var path = NewPack();
|
||||
Fill(path, 5);
|
||||
var length = new FileInfo(path).Length;
|
||||
using (var writer = ThumbPackWriter.Open(path))
|
||||
{
|
||||
// Frame 1 deleted: the frames after it move down one; nothing changes when nothing moves.
|
||||
writer.Rekey(new Dictionary<int, int> { [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4 });
|
||||
Assert.Equal(length, new FileInfo(path).Length);
|
||||
writer.Rekey(new Dictionary<int, int> { [0] = 0, [2] = 1, [3] = 2, [4] = 3 });
|
||||
}
|
||||
Assert.True(new FileInfo(path).Length < length, "only the index is written again");
|
||||
using (var reader = ThumbPackReader.Open(path))
|
||||
{
|
||||
Assert.Equal(4, reader.Entries.Count);
|
||||
Assert.BytesEqual(Payload(0), reader.Read(0));
|
||||
Assert.BytesEqual(Payload(2), reader.Read(1));
|
||||
Assert.BytesEqual(Hash(4), reader.Entries[3].SourceHash);
|
||||
Assert.BytesEqual(Payload(4), reader.Read(3));
|
||||
Assert.Null(reader.Read(4));
|
||||
}
|
||||
|
||||
// A frame put back at index 1 later: the others move up, and the writer appends after the new index.
|
||||
using (var writer = ThumbPackWriter.Open(path))
|
||||
{
|
||||
writer.Rekey(new Dictionary<int, int> { [0] = 0, [1] = 2, [2] = 3, [3] = 4 });
|
||||
writer.Append(1, 320, 213, Hash(1), Payload(1));
|
||||
}
|
||||
using var again = ThumbPackReader.Open(path);
|
||||
Assert.Equal(5, again.Entries.Count);
|
||||
for (var i = 0; i < 5; i++) Assert.BytesEqual(Payload(i), again.Read(i));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AppendingAgainReplacesAFrameAndKeepsTheOthers()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user