Merge branch 'fix/proxies-render-sync': proxies from clients and nodes, node manifests, sync and mass-rename fixes, server polling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
45 files changed
+1833
-179
No files matched your search
@@ -142,6 +142,25 @@ public sealed class TitanoClient : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the proxy of a frame whose original the server cannot decode (<see cref="ManifestFrame.WantsProxy"/>): a JPEG
|
||||
/// with the frame's capture time in its Exif, replacing the server's. A transient failure is retried.
|
||||
/// </summary>
|
||||
public Task UploadProxyAsync(Guid frameId, byte[] jpeg, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(jpeg);
|
||||
return RetryAsync(async () =>
|
||||
{
|
||||
await Bandwidth.AcquireAsync(jpeg.Length, ct).ConfigureAwait(false);
|
||||
using var content = new ByteArrayContent(jpeg);
|
||||
content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
|
||||
using var response = await SendRawAsync(new HttpRequestMessage(HttpMethod.Put, $"api/v1/frames/{frameId}/proxy") { Content = content }, ct)
|
||||
.ConfigureAwait(false);
|
||||
await EnsureSuccessAsync(response, ct).ConfigureAwait(false);
|
||||
return true;
|
||||
}, ct);
|
||||
}
|
||||
|
||||
// ---------------- Uploads ----------------
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -37,7 +37,10 @@ public sealed record NodeEncoder(string Codec, string Name, bool Hardware, bool
|
||||
public sealed record RenderNodeDto(Guid Id, string ClientName, string Username, IReadOnlyList<NodeEncoder> Encoders, DateTimeOffset LastHeartbeat, string State);
|
||||
|
||||
/// <summary><c>POST /api/v1/nodes/{id}/claim</c>: the job and everything needed to run it, or 204 when none matches.</summary>
|
||||
public sealed record ClaimedJob(JobDto Job, Guid SequenceId, string SettingsJson, string PresetJson, bool UseProxies, IReadOnlyList<ManifestFrame> Frames);
|
||||
/// <param name="Frames">Every frame of the sequence; a node renders none flagged missing, corrupt or excluded.</param>
|
||||
/// <param name="Proxies">How to make the proxies the server asks for (<see cref="ManifestFrame.WantsProxy"/>); null when it makes none.</param>
|
||||
public sealed record ClaimedJob(JobDto Job, Guid SequenceId, string SettingsJson, string PresetJson, bool UseProxies, IReadOnlyList<ManifestFrame> Frames,
|
||||
ProxySpec? Proxies = null);
|
||||
|
||||
/// <summary><c>POST /api/v1/nodes/{id}/jobs/{jobId}/progress</c>.</summary>
|
||||
public sealed record NodeProgress(long Done, long Total, double? ItemsPerSecond, string? LogLine);
|
||||
|
||||
@@ -65,6 +65,7 @@ public sealed record FrameDto(
|
||||
long Flags);
|
||||
|
||||
/// <summary><c>GET /api/v1/sequences/{id}/manifest</c>: what a client needs to diff a sequence (BRIEF §14.5).</summary>
|
||||
/// <param name="Proxies">How to make the proxies the server asks for (<see cref="ManifestFrame.WantsProxy"/>); null when it makes none.</param>
|
||||
public sealed record SequenceManifest(
|
||||
Guid SequenceId,
|
||||
int FramesVersion,
|
||||
@@ -72,9 +73,21 @@ public sealed record SequenceManifest(
|
||||
string? SettingsJson,
|
||||
IReadOnlyList<string> Tags,
|
||||
IReadOnlyList<ManifestFrame> Frames,
|
||||
IReadOnlyList<RenderDto> Renders);
|
||||
IReadOnlyList<RenderDto> Renders,
|
||||
ProxySpec? Proxies = null);
|
||||
|
||||
public sealed record ManifestFrame(Guid Id, int Index, string FileName, long Size, string Sha256, bool HasProxy, bool HasThumb);
|
||||
/// <summary>One frame of a manifest: its content, whether the server has a proxy and thumbnail of it, and its flags.</summary>
|
||||
/// <param name="Sha256">Lower-case hex SHA-256; empty while the server has not hashed it (a folder adopted and not verified yet).</param>
|
||||
/// <param name="Flags">The frame's <c>FrameFlags</c> bits (missing, corrupt, excluded…).</param>
|
||||
/// <param name="WantsProxy">
|
||||
/// The server cannot decode this original and has no proxy of it (BRIEF §2.3, §8.1: HEIF): a client or render node that
|
||||
/// decodes it sends one with <c>PUT /api/v1/frames/{id}/proxy</c>, made as <see cref="SequenceManifest.Proxies"/> says.
|
||||
/// </param>
|
||||
public sealed record ManifestFrame(Guid Id, int Index, string FileName, long Size, string Sha256, bool HasProxy, bool HasThumb, long Flags = 0,
|
||||
bool WantsProxy = false);
|
||||
|
||||
/// <summary>How the server's proxies are made (BRIEF §8.5): long edge in pixels (0 = full size) and JPEG quality.</summary>
|
||||
public sealed record ProxySpec(int LongEdge, int Quality);
|
||||
|
||||
public sealed record RenderDto(
|
||||
Guid Id,
|
||||
|
||||
Reference in new issue
Block a user