fix(proxies): get proxies of undecodable originals from clients and nodes
The server decodes with managed decoders only, so HEIF originals had no
proxies, thumbnails from their small previews and no pixels for analysis or
managed renders, and nothing could send it proxies (ENG-05). Manifests now
carry the archive's proxy spec and, per frame, its flags and whether the
server wants its proxy. PUT /api/v1/frames/{id}/proxy (Edit or RenderNode)
stores a JPEG of at most 64 MiB that decodes and whose Exif capture time is
the frame's, then queues thumbnails and the proxy pass. An upload from the
desktop makes and sends the wanted proxies after the originals and counts
them as local changes; a render node sends those it can make from the
originals it fetched once the job is done. The server never makes such a
proxy from a preview, drops one left by a renumbered frame, takes thumbnails
from a proxy, and analyses and renders those frames from their proxies.
Render nodes fetched every frame of the manifest: frames missing, corrupt or
excluded on the server failed the download, and originals not hashed yet
failed the SHA-256 check (ENG-07). Nodes now skip those frames, fetch unhashed
originals into the job folder with a size check, judge decodability with their
own decoders, and use the proxy of a frame they cannot decode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
28 files changed
+1005
-94
No files matched your search
@@ -43,8 +43,9 @@ public sealed record SyncOptions
|
||||
/// conflict the user settles with <see cref="ResolveAsync"/>, against the versions the user was shown. Uploads and
|
||||
/// downloads run as jobs (<see cref="CreateJobHandlers"/>): uploads use the chunked, hash-verified, resumable protocol;
|
||||
/// downloaded originals are verified and committed through the archive ingest, so sidecars stay right; proxies go to a
|
||||
/// cache and open as a <see cref="RemoteSequence"/>; renders travel on request. Proxies and thumbnails never travel
|
||||
/// upward. A local copy and a server sequence holding the same originals are linked by content when no link joins
|
||||
/// cache and open as a <see cref="RemoteSequence"/>; renders travel on request. Thumbnails never travel upward, and
|
||||
/// proxies only for originals the server cannot decode (BRIEF §2.3: HEIF), made here and counted with the originals the
|
||||
/// server lacks. A local copy and a server sequence holding the same originals are linked by content when no link joins
|
||||
/// them. The state of each local sequence is written to its <c>sync_state</c> for the Library. A failure while
|
||||
/// comparing one sequence is recorded on its link and does not stop the others.
|
||||
/// </summary>
|
||||
@@ -494,8 +495,10 @@ public sealed class SyncService
|
||||
manifest = await remote.GetManifestAsync(link.RemoteId, cancellationToken).ConfigureAwait(false);
|
||||
var frames = await SequenceFrames.ListAsync(_db, local.Id, cancellationToken).ConfigureAwait(false);
|
||||
// A frame flagged missing here counts as absent: downloading the originals restores it from the server.
|
||||
var (missingRemote, missingLocal) = SyncRules.CompareOriginals(
|
||||
[.. frames.Where(f => (f.Flags & FrameFlags.Missing) == 0).Select(f => f.Sha256)], [.. manifest.Frames.Select(f => f.Sha256)]);
|
||||
var present = frames.Where(f => (f.Flags & FrameFlags.Missing) == 0).ToList();
|
||||
var (missingRemote, missingLocal) = SyncRules.CompareOriginals([.. present.Select(f => f.Sha256)], [.. manifest.Frames.Select(f => f.Sha256)]);
|
||||
// Proxies the server asks for that this PC can make from its originals travel with an upload too (BRIEF §2.3).
|
||||
if (policy.CanEdit && manifest.Proxies is not null) missingRemote += SyncRules.ProxiesToSend(manifest, present, Options.Archive.Decoder);
|
||||
link = await CompareExportsAsync(link, local, manifest.Renders, cancellationToken).ConfigureAwait(false) with
|
||||
{
|
||||
DiffLocalFrames = local.FramesVersion,
|
||||
|
||||
Reference in new issue
Block a user