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

+60 -2
View File
@@ -16,10 +16,11 @@ public sealed record FrameDeleteResultDto(Guid SequenceId, int Photos, long Byte
/// <summary>
/// An entry of the archive's trash (<c>GET /api/v1/archive/trash</c>): a deleted sequence (<see cref="Kind"/> <c>sequence</c>)
/// or photos deleted from one (<c>photos</c>; <c>replaced</c> for originals a conversion replaced). <see cref="Name"/>
/// identifies it in restore and empty requests.
/// identifies it in restore and empty requests. In the dry run of an emptying, <see cref="ConversionDeleted"/> marks
/// replaced originals whose conversion was deleted since, which may be the last copy of their photos.
/// </summary>
public sealed record TrashEntryDto(string Name, string Kind, Guid SequenceId, string Title, string Folder, int Photos, int Files, long Bytes,
string? DeletedBy, DateTimeOffset DeletedAt);
string? DeletedBy, DateTimeOffset DeletedAt, bool ConversionDeleted = false);
/// <summary><c>GET /api/v1/archive/trash</c>: the entries, newest first, and their total size.</summary>
public sealed record TrashListDto(IReadOnlyList<TrashEntryDto> Entries, long Bytes);
@@ -123,3 +124,60 @@ public sealed record ReorganizeStepDto(Guid SequenceId, string FromFolder, strin
/// whole, <c>unreadable</c>, counts none), and the fingerprint the change sends back.
/// </summary>
public sealed record ReorganizePlanDto(IReadOnlyList<ReorganizeStepDto> Steps, int Sequences, int Files, int Kept, string Fingerprint);
/// <summary>
/// <c>POST /api/v1/archive/convert</c> (owner review 2, R7; administrators of the archive): the photos of
/// <see cref="SequenceIds"/>, or of every sequence with <see cref="All"/> (exactly one of the two), converted to
/// <see cref="Target"/> (<c>jpeg</c>, <c>tiff16</c> or <c>linear-dng</c>, the archival choice) with <see cref="Quality"/> 1–100
/// for a JPEG (default 95, ignored otherwise). <see cref="Mode"/>, chosen at every run: <c>replace</c> (the converted files
/// become the frames, the originals go to the archive's trash) or <c>new-sequence</c> (copies in a new sequence, the source
/// untouched, the photos it leaves as they are not copied into it). <see cref="DryRun"/> answers the plan
/// (<see cref="ConvertPlanDto"/>) and changes nothing; the server keeps it a few minutes, a refusal too, so the same dry run
/// again (also after one cut off, in either mode, at any quality of a lossless target) is answered from it with the busy
/// sequences and the free space as they are then; 503 <c>plan_dropped</c> when the server stopped making it (it took too
/// long, or too many were asked at once). The change itself sends that plan's <see cref="Fingerprint"/> back and takes the
/// plan kept (503 <c>plan_dropped</c> when none is kept for the index as it is now, let go since or the index changed in
/// what the plan reads, the sequences' rows and the formats, sizes, hashes and flags of their photos: ask the dry run
/// again, then confirm that one; 409 <c>plan_changed</c> when the plan kept is not the one confirmed: a job made one of its
/// sequences busy or free since, or a conversion of them was queued) and runs as a <c>convert</c> job (202), which
/// converts the photos of that plan alone and leaves as it is a sequence where one of them no longer fits.
/// </summary>
public sealed record ConvertRequest(IReadOnlyList<Guid>? SequenceIds, bool All, string? Target, int? Quality, string? Mode, bool DryRun,
string? Fingerprint = null);
/// <summary>
/// Photos of a sequence a conversion leaves as they are: <see cref="Reason"/> <c>same_format</c>, <c>convert_on_pc</c> (the
/// server cannot read them at full resolution: a CR3, a HEIC, a body its RAW decoder does not support), <c>undecodable</c>,
/// <c>missing</c>, <c>unhashed</c> (never verified), <c>eight_bit</c> (a RAW the host develops at 8 bits only, for a 16-bit
/// target), <c>color_profile</c> (a colour profile the target can neither keep nor convert to), <c>too_large</c> or
/// <c>inaccessible</c> (another program held the file open, or it could not be opened, when the plan was made), how many,
/// and the reason as one localised sentence: of a sequence <c>new-sequence</c> copies, that the new sequence lacks them (it
/// holds the converted copies alone).
/// </summary>
public sealed record ConvertSkippedDto(string Reason, int Photos, string Message);
/// <summary>Why a whole sequence is not converted now: <see cref="Reason"/> <c>busy</c>, <c>offline</c>, <c>unreadable</c> or <c>frames_changed</c>, as one localised sentence too.</summary>
public sealed record ConvertBlockedDto(string Reason, string Message);
/// <summary>
/// One sequence of a conversion plan: its title, folder and the frames version it was planned at, the photos converted
/// with their size now and the estimated size after, the photos left as they are and why, and what blocks the sequence
/// (it is then not converted).
/// </summary>
public sealed record ConvertSequenceDto(Guid SequenceId, string Title, string Folder, int FramesVersion, int Photos, long BytesBefore, long BytesAfter,
IReadOnlyList<ConvertSkippedDto> Skipped, IReadOnlyList<ConvertBlockedDto> Blocked);
/// <summary>
/// The space a conversion needs on the archive's volume (the estimate × 1.15 plus a 512 MiB reserve; with <c>replace</c> the
/// originals stay in the trash, so it adds up), what is free there (null when it cannot be measured), whether it is
/// enough, and the line the dialog shows.
/// </summary>
public sealed record ConvertSpaceDto(long Required, long? Free, bool Enough, string Message);
/// <summary>
/// The dry run of a conversion: the target, quality and mode, each sequence asked for in order (<see cref="Steps"/>), the
/// sequences and photos converted, the photos skipped, the bytes before and the estimate after, the space, and the
/// fingerprint the change sends back.
/// </summary>
public sealed record ConvertPlanDto(string Target, int Quality, string Mode, IReadOnlyList<ConvertSequenceDto> Steps, int Sequences, int Photos, int Skipped,
long BytesBefore, long BytesAfter, ConvertSpaceDto Space, string Fingerprint);
+2
View File
@@ -89,4 +89,6 @@ namespace Chronos.Protocol;
[JsonSerializable(typeof(LibraryFacetsDto))]
[JsonSerializable(typeof(ReorganizeRequest))]
[JsonSerializable(typeof(ReorganizePlanDto))]
[JsonSerializable(typeof(ConvertRequest))]
[JsonSerializable(typeof(ConvertPlanDto))]
public sealed partial class ProtocolJson : JsonSerializerContext;