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

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:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-11-03 10:41:50 +01:00
1 parent 7e4a3b481d
commit efa87f68ce
354 files changed
+24530 -843

No files matched your search

@@ -86,6 +86,28 @@ internal sealed class SyncFixture : IAsyncDisposable
null, null), Ct);
}
/// <summary>
/// Replaces the file of the local frame at <paramref name="index"/> with <paramref name="converted"/>, as a conversion's
/// Replace does on this PC (owner review 2, R7): the same frame, a tombstone naming the new content.
/// </summary>
public async Task ReplaceLocalAsync(Guid sequenceId, int index, byte[] converted)
{
var sequence = (await Db.Sequences.GetAsync(sequenceId, Ct))!;
var frame = Chronos.Core.Archiving.ManifestStore.ReadSequence(Archive.Paths.Sequence(sequence.Folder).ManifestPath).Frames[index];
var staging = Path.Combine(Archive.Paths.StagingDirectory, "convert-test");
Directory.CreateDirectory(staging);
var path = Path.Combine(staging, $"{Guid.NewGuid():N}.jpeg");
await File.WriteAllBytesAsync(path, converted, Ct);
var sha = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(converted));
var swap = new FrameSwap(frame.Id, Archive.Paths.ToRelative(path), [], (current, _) => Path.ChangeExtension(current.File, ".jpeg"), current => current with
{
Sha256 = sha,
Size = converted.Length,
Source = new Chronos.Core.Archiving.FrameSource { Sha256 = current.Sha256, Format = current.Format, File = current.File, Size = current.Size },
});
Assert.NotNull(await Archive.Service.FrameTrash.ReplaceAsync(Archive.Archive, sequenceId, null, [swap], null, null, null, null, Ct));
}
/// <summary>An edit on this PC, as the editor makes it (project file and index, settings version + 1).</summary>
public async Task<Sequence> EditLocalSettingsAsync(Guid id, string settingsJson)
{