From 08d21d3bde298941db28277b7395986654c76681 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 23:51:13 +0000 Subject: [PATCH] refactor(server): render jobs posted to the server take the client's label format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The server wrote "title → preset" by hand; it now uses ProcessingJobs.RenderLabel, the Jobs.Target.Render resource the desktop uses, whose right-to-left variant points the arrow the reading way. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- src/Titano.Data/Processing/ProcessingJobs.cs | 12 ++++++++---- src/Titano.Server/Api/JobEndpoints.cs | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Titano.Data/Processing/ProcessingJobs.cs b/src/Titano.Data/Processing/ProcessingJobs.cs index 4bb3fac7..245e91cd 100644 --- a/src/Titano.Data/Processing/ProcessingJobs.cs +++ b/src/Titano.Data/Processing/ProcessingJobs.cs @@ -37,13 +37,17 @@ public static class ProcessingJobs ArgumentNullException.ThrowIfNull(sequence); ArgumentNullException.ThrowIfNull(export); var parameters = Parameters(export, sourceWidth, sourceHeight, project?.ToJson(), useProxies); - // The label is stored as written, in the language of the moment like the preset name: its arrow points from the - // sequence to the preset in that language's reading direction. - var label = Loc.L(Loc.IsRightToLeft ? "Jobs.Target.RenderRtl" : "Jobs.Target.Render", sequence.DisplayTitle, parameters.PresetName); - return new ArchiveJobRequest(JobKind.Render, [sequence.Id], label, + return new ArchiveJobRequest(JobKind.Render, [sequence.Id], RenderLabel(sequence.DisplayTitle, parameters.PresetName), JsonSerializer.Serialize(parameters, ProtocolJson.Default.RenderJobParameters), JobPriority.User); } + /// + /// The label of a render job, "Harbour sunset → 4K HEVC". It is stored as written, in the language of the moment like + /// the preset name: its arrow points from the sequence to the preset in that language's reading direction. + /// + public static string RenderLabel(string title, string presetName) => + Loc.L(Loc.IsRightToLeft ? "Jobs.Target.RenderRtl" : "Jobs.Target.Render", title, presetName); + /// /// A posted render job as one job per preset, as makes them (a render node uploads one file /// per job): the job itself when it has no batch; otherwise its own preset, then each batch preset with its own values, diff --git a/src/Titano.Server/Api/JobEndpoints.cs b/src/Titano.Server/Api/JobEndpoints.cs index 4ee09131..63d407ed 100644 --- a/src/Titano.Server/Api/JobEndpoints.cs +++ b/src/Titano.Server/Api/JobEndpoints.cs @@ -106,8 +106,8 @@ public static class JobEndpoints return ApiErrors.BadRequest(context, "invalid_parameters", "parametersJson"); } queue = each.Count == 1 - ? [($"{label} → {render.PresetName}", request.ParametersJson)] - : [.. each.Select(p => ($"{label} → {p.PresetName}", (string?)JsonSerializer.Serialize(p, ProtocolJson.Default.RenderJobParameters)))]; + ? [(ProcessingJobs.RenderLabel(label, render.PresetName), request.ParametersJson)] + : [.. each.Select(p => (ProcessingJobs.RenderLabel(label, p.PresetName), (string?)JsonSerializer.Serialize(p, ProtocolJson.Default.RenderJobParameters)))]; } else if (request.ParametersJson is not null && !IsJsonObject(request.ParametersJson)) {