The quick Render on a remote card embedded the project it read, which may come from this PC's proxy cache and be older than the server's, so the node rendered stale settings. The job is now sized on that project without embedding it: the server renders the sequence's settings when a node takes the job, as before phase 4. Also restores the FramingRows doc comment that the ShownTurns insertion displaced, records the review-fix decisions in DECISIONS, updates the DESIGN crop keyboard/pan text (Enter selects, middle button pans) and corrects the plan's cover-zoom figure (about 1.43x at 15 degrees on 16:9) and merge-semantics note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.8 KiB
C#
53 lines
2.8 KiB
C#
using System.Text.Json;
|
|
using Chronos.App.Library;
|
|
using Chronos.Core.Localization;
|
|
using Chronos.Core.Model;
|
|
using Chronos.Core.Project;
|
|
using Chronos.Protocol;
|
|
using Chronos.Testing;
|
|
|
|
namespace Chronos.App.Tests.Library;
|
|
|
|
/// <summary>
|
|
/// The Library's Render on a remote card is held to the editor's rule (owner review 1, phase 4): settings or proportions a
|
|
/// server of an older settings format would render otherwise are not posted to it.
|
|
/// </summary>
|
|
public sealed class LibraryRenderGateTests
|
|
{
|
|
private static ExportSettings Uhd() => new() { Preset = new Auto<string>().WithManual("4k-h264") };
|
|
|
|
[Test]
|
|
public void AnOlderServerIsNotSentARenderItWouldGetWrong()
|
|
{
|
|
var plain = new ProjectSettings { Export = Uhd() };
|
|
var turned = plain with { Camera = new CameraSettings { Rotate = 90 } };
|
|
var portrait = plain with { Camera = new CameraSettings { Aspect = new Auto<string>().WithManual("9:16") } };
|
|
var newer = Loc.L("Tooltips.Server.NeedsNewerServer");
|
|
|
|
Assert.Null(LibraryActions.ServerCannotRender(plain, plain.Export, 6000, 4000, ProjectSettings.BaseVersion));
|
|
Assert.Equal(newer, LibraryActions.ServerCannotRender(turned, turned.Export, 6000, 4000, ProjectSettings.BaseVersion));
|
|
Assert.Equal(newer, LibraryActions.ServerCannotRender(portrait, portrait.Export, 6000, 4000, ProjectSettings.BaseVersion), "the proportions win only on a newer server");
|
|
Assert.Null(LibraryActions.ServerCannotRender(turned, turned.Export, 6000, 4000, ProjectSettings.CurrentVersion));
|
|
Assert.Null(LibraryActions.ServerCannotRender(portrait, portrait.Export, 6000, 4000, ProjectSettings.CurrentVersion));
|
|
}
|
|
|
|
/// <summary>
|
|
/// The remote card's render is sized on the project just read (the card's copy may be older: here 16:9 against 9:16) and
|
|
/// does not embed it, so the server renders the sequence's settings as they are when a node takes the job.
|
|
/// </summary>
|
|
[Test]
|
|
public void ARemoteRenderIsSizedOnTheProjectReadAndRendersTheServersSettings()
|
|
{
|
|
var project = new ProjectSettings { Export = Uhd(), Camera = new CameraSettings { Aspect = new Auto<string>().WithManual("9:16") } };
|
|
var card = new Sequence { Id = Guid.NewGuid(), ArchiveId = Guid.NewGuid(), Folder = "harbour", SettingsJson = new ProjectSettings { Export = Uhd() }.ToJson() };
|
|
|
|
var request = LibraryActions.ServerRender(card, project, project.Export, 6000, 4000);
|
|
|
|
Assert.Equal(card.Id, request.Target.Single());
|
|
var parameters = JsonSerializer.Deserialize(request.ParametersJson!, ProtocolJson.Default.RenderJobParameters)!;
|
|
Assert.Equal((2160, 3840), (parameters.Width, parameters.Height));
|
|
Assert.Null(parameters.SettingsJson);
|
|
Assert.Equal(2, parameters.RequiredSettingsFormat);
|
|
}
|
|
}
|