fix(proxies): ask again for preview-sized proxies and refuse unwanted ones
Earlier versions made the server's proxies of HEIF frames from their embedded
previews. Those carry the frame's capture time, so the proxy pass kept them
and the sequence stayed marked as having all its proxies; renders and
analysis then read thumbnail-sized files and no client or render node was
asked for a real one. The proxy pass now treats a proxy whose long edge falls
short of the policy's for the frame (its own size when smaller, a tenth of
slack, frames of unknown size not judged) as stale, and the server refuses
such a proxy when one is sent (422 proxy_too_small).
PUT /api/v1/frames/{id}/proxy also took a proxy of a frame the server
decodes itself, replacing its own proxy with any JPEG of the right capture
time; it now answers 422 proxy_not_wanted for those and for frames missing or
damaged. Its follow-up jobs are queued even when the sender disconnects once
the proxy is filed.
A render node cleared the server's Undecodable flag on every frame, so a
damaged frame the server's own render skips was downloaded and failed the
node's job. Only a format the server cannot decode and the node can loses the
flag now; other undecodable originals are neither fetched nor rendered unless
read from their proxy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
9 files changed
+112
-25
No files matched your search
@@ -245,9 +245,13 @@ public sealed class RenderNodeClient : IAsyncDisposable
|
||||
var project = ProjectStore.Parse(claimed.SettingsJson) with { Export = export };
|
||||
|
||||
var sequence = ToSequence(await _client.GetSequenceAsync(claimed.SequenceId, cancellationToken).ConfigureAwait(false));
|
||||
// This PC's decoders judge what they can read: the server's Undecodable does not keep a frame out of the render here.
|
||||
// The server's Undecodable stands, as in its own render, except for a format only its decoders lack (HEIF) that
|
||||
// this PC's read: such a frame renders here from its original. One read from its proxy renders either way.
|
||||
var decoder = _processing.Archive.Decoder;
|
||||
var frames = (await ListFramesAsync(claimed.SequenceId, cancellationToken).ConfigureAwait(false))
|
||||
.ConvertAll(f => f with { Flags = f.Flags & ~FrameFlags.Undecodable });
|
||||
.ConvertAll(f => ArchiveImages.ServerNeedsProxy(f.Format) && !ArchiveImages.NeedsProxy(decoder, f.Format)
|
||||
? f with { Flags = f.Flags & ~FrameFlags.Undecodable }
|
||||
: f);
|
||||
var files = await DownloadAsync(claimed, frames, work, reporter, cancellationToken).ConfigureAwait(false);
|
||||
var input = new SequenceFrames(sequence, frames, [.. frames.Select(f => files.GetValueOrDefault(f.Id).Path)])
|
||||
{
|
||||
@@ -357,10 +361,12 @@ public sealed class RenderNodeClient : IAsyncDisposable
|
||||
NodeReporter reporter, CancellationToken cancellationToken)
|
||||
{
|
||||
var formats = rows.ToDictionary(f => f.Id, f => f.Format);
|
||||
var undecodable = rows.Where(f => (f.Flags & FrameFlags.Undecodable) != 0).Select(f => f.Id).ToHashSet();
|
||||
bool Proxy(ManifestFrame f) =>
|
||||
f.HasProxy && (claimed.UseProxies || (formats.TryGetValue(f.Id, out var format) && ArchiveImages.NeedsProxy(_processing.Archive.Decoder, format)));
|
||||
var files = new Dictionary<Guid, (string, bool)>();
|
||||
var fetched = claimed.Frames.Where(f => ((FrameFlags)f.Flags & NotFetched) == 0).ToList();
|
||||
// An original that stays undecodable would only be skipped by the render.
|
||||
var fetched = claimed.Frames.Where(f => ((FrameFlags)f.Flags & NotFetched) == 0 && (Proxy(f) || !undecodable.Contains(f.Id))).ToList();
|
||||
var done = 0;
|
||||
var total = fetched.Count;
|
||||
await reporter.ReportAsync(0, total, Loc.L("Export.Job.Downloading")).ConfigureAwait(false);
|
||||
|
||||
Reference in new issue
Block a user