fix(proxies): use only a frame's own proxy and let tiers, reports and built flags follow it
- Renders, analyses, the server's manifests and proxy downloads take a proxy only when its Exif capture time is the frame's (ArchiveImages.IsProxyOf); one left at the index by a frame renumbered since counts as missing and is asked for again (V-24). - A frame whose original the host reads through its proxy (HEIF on the server) is preview-only only while it has none: the light analysis and the proxy pass keep the flag, the preview-only count, the light finding and the advisor's output cap in step with the proxies, and an arriving proxy queues a light analysis on the server (V-1, V-25). - The deep checkpoint's content key includes whether each frame is read from its original or its proxy, and analysis.json lists the frames measured from proxies; an unreadable verdict on a frame now read from its proxy makes the report stale (V-26). - Thumbnails drawn from proxies are compared with the archive's thumbnail size instead of 320 px (V-27). - A resumed thumbnail or proxy pass sets ThumbsBuilt/ProxiesBuilt only when the frames an earlier run did still have theirs, and the proxy pass logs frames waiting for a client's proxy apart from unreadable ones (V-28). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
22 files changed
+601
-59
No files matched your search
@@ -161,6 +161,13 @@ public sealed record DeepAnalysisReport
|
||||
/// <summary>Suggested hero frame: sharp, well exposed, near golden hour or mid-sequence, not excluded.</summary>
|
||||
public int? HeroIndex { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Frames measured from their proxies, ascending, because the analysing host cannot decode their originals (HEIF on the
|
||||
/// server, BRIEF §2.3); null when none were. An unreadable verdict on a frame read from its original no longer holds
|
||||
/// once the frame is read from a proxy.
|
||||
/// </summary>
|
||||
public int[]? ProxyFrames { get; init; }
|
||||
|
||||
public IReadOnlyList<DeepFinding> Findings { get; init; } = [];
|
||||
|
||||
public string ToJson() => JsonSerializer.Serialize(this, DeepAnalysisJson.Default.DeepAnalysisReport);
|
||||
|
||||
@@ -57,10 +57,12 @@ public static class SequenceFrames
|
||||
/// <param name="damaged">For the unavailable tier: whether that proves the file unreadable. False when the host has no
|
||||
/// native decoder for the format, so a client or render node with one (or a proxy) may still produce its pixels: the
|
||||
/// tier is kept and <see cref="FrameFlags.Undecodable"/> is left as it was.</param>
|
||||
public static SidecarFrame WithTier(SidecarFrame frame, FileTier tier, bool damaged = true)
|
||||
/// <param name="proxied">Whether the host takes the frame's pixels from its proxy (an original it cannot decode, whose
|
||||
/// proxy is there): see <see cref="WithProxy"/>.</param>
|
||||
public static SidecarFrame WithTier(SidecarFrame frame, FileTier tier, bool damaged = true, bool proxied = false)
|
||||
{
|
||||
var flags = frame.Flags & ~(FrameFlags.PreviewOnly | FrameFlags.Undecodable);
|
||||
if (tier.Tier == DecodeTier.EmbeddedPreview) flags |= FrameFlags.PreviewOnly;
|
||||
if (tier.Tier == DecodeTier.EmbeddedPreview) flags |= proxied ? FrameFlags.None : FrameFlags.PreviewOnly;
|
||||
else if (tier.Tier == DecodeTier.Unavailable) flags |= damaged ? FrameFlags.Undecodable : frame.Flags & FrameFlags.Undecodable;
|
||||
var (w, h) = tier.Tier == DecodeTier.EmbeddedPreview && tier.Width > 0 && tier.Height > 0
|
||||
? PixelConvert.OrientedSize(tier.Width, tier.Height, frame.Orientation)
|
||||
@@ -68,6 +70,16 @@ public static class SequenceFrames
|
||||
return frame with { Tier = tier.Tier, Flags = flags, PreviewW = Positive(w), PreviewH = Positive(h) };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The frame with <see cref="FrameFlags.PreviewOnly"/> following its proxy, for a host that takes the pixels of the
|
||||
/// frame's original from its proxy (HEIF on the server, BRIEF §2.3, §8.1): an embedded-preview frame is read from its
|
||||
/// preview, so preview-only, only while <paramref name="proxied"/> is false. The tier and the preview size stay the
|
||||
/// original's; other tiers are left as they are.
|
||||
/// </summary>
|
||||
public static SidecarFrame WithProxy(SidecarFrame frame, bool proxied) => frame.Tier != DecodeTier.EmbeddedPreview
|
||||
? frame
|
||||
: frame with { Flags = proxied ? frame.Flags & ~FrameFlags.PreviewOnly : frame.Flags | FrameFlags.PreviewOnly };
|
||||
|
||||
private static int? Positive(int? value) => value > 0 ? value : null;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -117,7 +117,8 @@ public sealed record SidecarFrame
|
||||
|
||||
/// <summary>
|
||||
/// Decode tier of the file (BRIEF §8.2) as the host that indexed or decoded it last found it; omitted until it is
|
||||
/// known. <see cref="FrameFlags.PreviewOnly"/> and <see cref="FrameFlags.Undecodable"/> follow it.
|
||||
/// known. <see cref="FrameFlags.PreviewOnly"/> (unless that host reads the frame from its proxy) and
|
||||
/// <see cref="FrameFlags.Undecodable"/> follow it.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(TolerantEnumConverter<DecodeTier>))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
|
||||
Reference in new issue
Block a user