feat: phase 5 groundwork (playback format 3, videos contracts, migration 0010, strings)

Lays down every contract the later parcels of owner review 1 phase 5 build on,
so they compile against shared types without touching each other's files.

- Settings format 3: export.playback (direction, loops, fades, hold), omitted
  at its default and member by member; RequiredFormat is 3 only while used.
- OutputProgram public API with a forward-only body; still-frame job
  parameters (StillFrame, StillPhoto) routed to format-3 nodes only.
- Render.Sha256/Kind, RenderCopy, RenderKind; JobKind.VideoCopy = 24.
- Migration 0010 (sqlite, postgres): renders.sha256/kind, ix_renders_created,
  render_copies without a foreign key.
- Videos protocol DTOs, client calls, ServerCapabilities.Videos (declared,
  not announced yet), ServerSettingsDto.VideosPath.
- IVideoLibrary with a NotImplemented stub registered on the server;
  TrashKind.Videos, VideoTrashNames, VideoErrors.
- en and it strings for the whole phase, five icons, decisions 1-22 and the
  open-question defaults; tests that used format 3 as "newer" now use 4.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-05 01:48:33 +01:00
1 parent 86aa07c1d7
commit d472dfdec1
67 files changed
+2233 -244

No files matched your search

@@ -11,6 +11,7 @@ public abstract class MigrationTests(TestContext context) : RepositoryTest(conte
[
"archives", "sequences", "frames", "renders", "jobs", "media_cards", "import_history", "users", "tokens",
"render_nodes", "settings", "tags", "sequence_tags", "audit_log", "uploads", "schedules", "frame_removals", "projects", "project_versions",
"render_copies",
];
[Test]
@@ -103,6 +104,41 @@ public abstract class MigrationTests(TestContext context) : RepositoryTest(conte
Assert.Null(await chronos.Projects.GetVersionAsync(version.Id, Ct));
}
[Test]
public async Task RendersKeepTheirHashAndKindAndCopiesOutliveThem()
{
var chronos = await OpenChronosAsync();
var archive = TestData.Archive("Main");
await chronos.Archives.UpsertAsync(archive, Ct);
var sequence = TestData.Sequence(archive.Id);
await chronos.Sequences.UpsertAsync(sequence, Ct);
var now = DateTimeOffset.UtcNow;
var render = new Render { Id = Guid.CreateVersion7(), SequenceId = sequence.Id, PresetName = "PNG", OutputPath = "x/exports/a.png", Created = now };
await chronos.Renders.InsertAsync(render, Ct);
await using var session = await chronos.Database.OpenAsync(Ct);
// Rows recorded before migration 0010 have neither: null, told apart by the codec.
Assert.Equal(1L, await session.ScalarAsync<long>("SELECT count(*) FROM renders WHERE sha256 IS NULL AND kind IS NULL", [], Ct));
var hash = new string('a', 64);
await session.ExecuteAsync("UPDATE renders SET sha256 = $1, kind = $2 WHERE id = $3", [hash, "still", render.Id], Ct);
Assert.Equal(hash, await session.ScalarAsync<string>("SELECT sha256 FROM renders WHERE id = $1", [render.Id], Ct));
Assert.Equal("still", await session.ScalarAsync<string>("SELECT kind FROM renders WHERE id = $1", [render.Id], Ct));
// A copy names its render without a foreign key: it is kept when the render goes, and may name one never stored here.
foreach (var renderId in new[] { render.Id, Guid.CreateVersion7() })
{
await session.ExecuteAsync(
"INSERT INTO render_copies (id, render_id, path, sha256, bytes, copied_at, copied_by) VALUES ($1, $2, $3, $4, $5, $6, $7)",
[Guid.CreateVersion7(), renderId, $"C:/Videos/{renderId:N}.png", hash, 1234L, now, "admin"], Ct);
}
await chronos.Renders.DeleteAsync(render.Id, Ct);
Assert.Equal(2L, await session.ScalarAsync<long>("SELECT count(*) FROM render_copies", [], Ct));
Assert.Equal(1234L, await session.ScalarAsync<long>("SELECT bytes FROM render_copies WHERE render_id = $1", [render.Id], Ct));
// Bytes default to 0 and the hash and author may be null.
await session.ExecuteAsync("INSERT INTO render_copies (id, render_id, path, copied_at) VALUES ($1, $2, $3, $4)", [Guid.CreateVersion7(), render.Id, "C:/Videos/b", now], Ct);
Assert.Equal(0L, await session.ScalarAsync<long>("SELECT bytes FROM render_copies WHERE path = $1", ["C:/Videos/b"], Ct));
}
[Test]
public async Task AppliesOnlyPendingMigrations()
{