feat: export panel and Render menu, playback options, videos library (owner review 1 phase 5) (#27)
CI / Build and test (push) Successful in 9m41s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m49s
CI / PostgreSQL 16 integration (push) Successful in 8m51s
CI / PostgreSQL 17 integration (push) Successful in 9m48s
CI / Docker image (push) Successful in 54s
Release / Server image (push) Successful in 1m39s

Owner review 1 R3, R8, R9. A grouped Export step and Render menu; encoding, playback (reverse, boomerang, loops, fades, hold) and still frames; one videos library on the desktop and the server with a verified trash and copies to a videos folder.

Closes #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #27.
This commit is contained in:
Alby96andClaude Opus 5.5 authored and Alby96 committed 2026-11-05 09:18:40 +01:00
1 parent 188b2c2e55
commit 728ffa35cb
729 files changed
+26954 -1652

No files matched your search

+7 -1
View File
@@ -3,6 +3,7 @@ using Chronos.Data;
using Chronos.Data.Archiving;
using Chronos.Data.Housekeeping;
using Chronos.Data.Jobs;
using Chronos.Data.Videos;
using Chronos.Protocol;
using Chronos.Server.Configuration;
using Chronos.Server.Events;
@@ -37,7 +38,7 @@ public static class ArchiveModule
var events = sp.GetRequiredService<EventHub>();
var volumes = sp.GetService<VolumeSpace>();
// Photos the running job processes at once: the settings' value as it is when each sequence starts (owner review 1).
return new ArchiveService(db, new ArchiveServiceOptions
var service = new ArchiveService(db, new ArchiveServiceOptions
{
// A Reorganize or a conversion tells connected clients of every sequence it changed or made (BRIEF §14.3).
SequenceChanged = async (id, change, ct) =>
@@ -71,9 +72,14 @@ public static class ArchiveModule
// Next to the index in the data folder, where the daily backups always went.
BackupDirectory = Path.Combine(options.DataPath, DatabaseBackups.DirectoryName),
});
// A copy job checks its folder again when it runs: the data folder is refused there too, as the settings refuse it.
service.Videos.ProtectedFolders = () => [options.DataPath];
return service;
});
services.AddSingleton<IArchiveIngest>(sp => sp.GetRequiredService<ArchiveService>().Ingest);
services.AddSingleton<IJobHandlerProvider>(sp => sp.GetRequiredService<ArchiveService>());
// The videos library of the archive's index (owner review 1, R9): /api/v1/videos.
services.AddSingleton<IVideoLibrary>(sp => sp.GetRequiredService<ArchiveService>().Videos);
services.AddSingleton<IFrameAssetLocator, ArchiveAssetLocator>();
}
}
@@ -11,6 +11,7 @@ public static class FileResponses
[".jpg"] = "image/jpeg",
[".jpeg"] = "image/jpeg",
[".png"] = "image/png",
[".apng"] = "image/apng",
[".gif"] = "image/gif",
[".tif"] = "image/tiff",
[".tiff"] = "image/tiff",
@@ -22,6 +23,9 @@ public static class FileResponses
[".mp4"] = "video/mp4",
[".mov"] = "video/quicktime",
[".avi"] = "video/x-msvideo",
// The admin panel's player (owner review 1, R9) plays what a browser's <video> takes.
[".webm"] = "video/webm",
[".m4v"] = "video/mp4",
}.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase);
public static string ContentTypeOf(string fileName) =>
+18
View File
@@ -66,11 +66,29 @@ public sealed class RenderStore(ChronosDatabase db, ServerArchive archive, TimeP
ProducedBy = producedBy,
ProjectId = projectId,
ProjectVersionId = projectVersionId,
// Verified against the bytes when the upload completed (owner review 1, R9: every single-file render hashed).
Sha256 = UploadRules.IsSha256(output.Sha256) ? output.Sha256.ToLowerInvariant() : null,
Kind = KindOf(output.Kind),
};
await db.Renders.InsertAsync(render, cancellationToken);
return (Render?)render;
}, cancellationToken);
/// <summary>The longest kind a render is recorded with.</summary>
private const int MaxKindLength = 32;
/// <summary>
/// The <see cref="Render.Kind"/> a client or a render node names, as recorded: null for a video or an image sequence (told
/// apart by the codec) and for anything that is not a plain lower-case word; a newer Chronos's kind as it is.
/// </summary>
public static string? KindOf(string? kind)
{
if (string.IsNullOrWhiteSpace(kind)) return null;
var word = kind.Trim().ToLowerInvariant();
if (word.Length > MaxKindLength || !word.All(c => c is (>= 'a' and <= 'z') or '-')) return null;
return word is RenderKind.Video or RenderKind.Sequence ? null : word;
}
private static string Unique(string folder, string fileName)
{
var candidate = Path.Combine(folder, fileName);
+2 -1
View File
@@ -98,8 +98,9 @@ public sealed class RenderUploads(
if (await uploads.StageVerifiedAsync(upload, cancellationToken) is not { } staged) return Outcome<RenderDto>.Fail(422, "hash_mismatch");
var sequence = await db.Sequences.GetAsync(sequenceId, cancellationToken);
// The hash just verified and the kind (a still, owner review 1, R9) are recorded with the render.
var result = new RenderResultRequest(output.FileName, output.Size, output.Sha256, output.PresetName, output.Codec, output.Width, output.Height, output.Fps,
output.DurationSeconds);
output.DurationSeconds, output.Kind);
Render? render;
try
{