fix: address the phase 5 review
Video trash moves across volumes commit once the verified copy has its name and leave an undeletable source whole behind a .leftover marker that the next start settles; deletes rehash under the lease. Restores honour the names renders are writing, and encoders never overwrite an output. Routing floors at the stored settings' format, kindless stills read as stills, star trails restart per loop, and settings the encoder ignored become render warnings. The Videos section fits beside the player, plays downloaded server copies, names blocked videos and says why actions are off; the admin panel offers no download for sequences or missing files and names a filtered sequence from its record. Refs #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d87a1bc6d
commit
1be273d0e4
38 files changed
+958
-160
No files matched your search
@@ -48,12 +48,12 @@ public sealed partial class AdminVideosTests(TestContext context)
|
||||
var page = await server.Client.GetStringAsync("/admin/pages/videos.js");
|
||||
var calls = ApiCall().Matches(page).Select(m => (Method: m.Groups[1].Value, Target: m.Groups[2].Value)).ToList();
|
||||
Assert.True(calls.Count >= 4, string.Join(", ", calls));
|
||||
// Reads the list and the server's videos folder; writes only the videos' delete and copy: no settings, no project,
|
||||
// no render, no job of its own.
|
||||
// Reads the list, the server's videos folder and a filtered sequence's title; writes only the videos' delete and copy:
|
||||
// no settings, no project, no render, no job of its own.
|
||||
foreach (var (method, target) in calls)
|
||||
{
|
||||
Assert.True(method is "get" or "post", $"api.{method}({target}");
|
||||
if (method == "get") Assert.True(target is "listQuery(" or @"""/api/v1/server/settings""", target);
|
||||
if (method == "get") Assert.True(target is "listQuery(" or @"""/api/v1/server/settings""" or "`/api/v1/sequences/${encodeURIComponent(id)}`", target);
|
||||
else Assert.True(target is @"""/api/v1/videos/copy""" or @"""/api/v1/videos/delete""", target);
|
||||
}
|
||||
Assert.Contains("return `/api/v1/videos?${p}`;", page);
|
||||
@@ -82,6 +82,14 @@ public sealed partial class AdminVideosTests(TestContext context)
|
||||
Assert.Contains(@"<video controls autoplay preload=""metadata"" src=""${attr(fileUrl(v))}""></video>", page);
|
||||
Assert.Contains("return `/api/v1/renders/${encodeURIComponent(v.id)}/file`;", page);
|
||||
Assert.Contains(@"shown?.addEventListener(""error"", () => {", page);
|
||||
// An image sequence (a folder, no single file) and a missing file have no download, in the bar or the player.
|
||||
Assert.Contains(@"if (videoKind(v) === ""sequence"") return ""Admin.Videos.Download.Folder.Tip"";", page);
|
||||
Assert.Contains(@"if (v.state === ""missing"") return ""Admin.Videos.Download.Missing.Tip"";", page);
|
||||
Assert.Contains(@"const downloadWhy = one ? downloadBlock(rows.find((v) => v.id === only)) : ""Admin.Videos.Download.One.Tip"";", page);
|
||||
Assert.Contains("if (!v || downloadBlock(v)) return;", page);
|
||||
Assert.Contains("${downloadBlock(v)\n", page);
|
||||
// A sequence filter whose videos are not on the page names the sequence from its own record.
|
||||
Assert.Contains("api.get(`/api/v1/sequences/${encodeURIComponent(id)}`)", page);
|
||||
// The list follows the jobs that end (a copy, a render), the sequences that change and a reconnection.
|
||||
Assert.Contains(@"if (e.type === ""jobState"" && JOB_ENDED.has(e.state)) refreshSoon(1500);", page);
|
||||
Assert.Contains(@"else if (e.type === ""reconnected"") refreshSoon(0);", page);
|
||||
|
||||
@@ -36,4 +36,24 @@ public sealed class PlaybackRoutingTests
|
||||
var still = ProcessingJobs.ReadRender(ProcessingJobs.Still(sequence, Mjpeg, VideoCodec.JpegSequence, 0, null, 96, 64, new ProjectSettings()).ParametersJson).Parameters;
|
||||
Assert.False(RenderNodeService.Renders(Node(2) with { Encoders = [new NodeEncoder(still.Codec, "managed", false, false)] }, still));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SettingsWrittenInFormatThreeNeverGoToAFormatTwoNodeEvenWhenTheJobDoesNotPlayBack()
|
||||
{
|
||||
// The sequence's own export plays back, so its settings text is stamped version 3; the job's preset does not.
|
||||
var stored = new ProjectSettings { Export = Mjpeg with { Playback = new PlaybackSettings { Loops = 3 } } }.ToJson();
|
||||
var read = ProcessingJobs.ReadSettings(stored)!;
|
||||
var sequence = new Sequence { Id = Guid.CreateVersion7(), ArchiveId = Guid.CreateVersion7(), Folder = "Roof", Title = "Roof" };
|
||||
var job = ProcessingJobs.ReadRender(ProcessingJobs.Render(sequence, Mjpeg, 96, 64, new ProjectSettings()).ParametersJson).Parameters;
|
||||
Assert.Equal(1, job.RequiredSettingsFormat);
|
||||
|
||||
var routed = ProcessingJobs.Routed(job, read, 96, 64);
|
||||
var split = ProcessingJobs.Split(job, 96, 64, read);
|
||||
|
||||
Assert.Equal(3, routed.RequiredSettingsFormat);
|
||||
Assert.True(split.All(p => p.RequiredSettingsFormat == 3));
|
||||
RegisterNodeRequest Node(int format) => new("node", [new NodeEncoder("mjpeg", "managed", false, false)], 0, 0, format);
|
||||
Assert.False(RenderNodeService.Renders(Node(2), routed), "a format-2 node cannot parse the settings it would be handed");
|
||||
Assert.True(RenderNodeService.Renders(Node(3), routed));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user