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

+42 -2
View File
@@ -8,6 +8,7 @@ using Chronos.App.Infrastructure;
using Chronos.App.Server;
using Chronos.App.Settings;
using Chronos.App.Shell;
using Chronos.App.Videos;
using Chronos.App.Workspace;
using Chronos.Core.Archiving;
using Chronos.Core.Diagnostics;
@@ -79,7 +80,7 @@ public sealed class SettingsViewModel : SectionViewModel
new(SettingsPage.General, ["Settings.General.Language", "Settings.General.Theme", .. ShowsStartup ? (string[])["Settings.General.Startup"] : [],
"Settings.General.Notifications", .. ProductFeatures.AdsEnabled ? (string[])["Settings.General.Usage"] : []]),
new(SettingsPage.Archive, ["Settings.Archive.Root", "Settings.Archive.Folders", "Settings.Archive.Files", "Settings.Archive.Proxies",
"Settings.Archive.Thumbnails"]),
"Settings.Archive.Thumbnails", "Settings.Archive.VideosFolder"]),
new(SettingsPage.Import, ["Import.Scan.Sessions", "Import.Label.Scan", "Import.Scan.Subfolders", "Import.Scan.Verify", "Import.Label.Duplicates",
"Import.Label.After", "Import.After.Eject"]),
new(SettingsPage.Analysis, ["Settings.Analysis.Width", "Settings.Analysis.Night", "Settings.Analysis.Stars", "Settings.Analysis.Deep"]),
@@ -121,6 +122,12 @@ public sealed class SettingsViewModel : SectionViewModel
Save();
_ = OfferReorganizeAsync(UpdateArchiveAsync(a => a with { Templates = a.Templates with { File = v } }), ReorganizeParts.Files);
}, () => Loc.L("Tooltips.Settings.FileTemplate"));
// Where Videos › Copy to folder puts copies (owner review 1, R9): empty leaves it unset; never inside the archive or the workspace.
VideosFolder = new EditableField(_s.VideosFolder ?? string.Empty, ValidateVideosFolder, v =>
{
_s.VideosFolder = v.Trim().Length == 0 ? null : Path.GetFullPath(v.Trim());
Save();
}, () => Loc.L("Tooltips.Settings.VideosFolder"));
FolderTemplate.PropertyChanged += (_, e) =>
{
if (e.PropertyName == nameof(EditableField.Text)) UpdatePreview();
@@ -216,6 +223,8 @@ public sealed class SettingsViewModel : SectionViewModel
});
BrowseArchiveCommand = new RelayCommand(() => Browse(ArchiveRoot, "Settings.Archive.PickTitle"));
BrowseCacheCommand = new RelayCommand(() => Browse(CacheFolder, "Settings.Storage.PickTitle"));
BrowseVideosCommand = new RelayCommand(() => Browse(VideosFolder, "Settings.Archive.VideosPickTitle"));
OpenVideosFolderCommand = new RelayCommand(OpenVideosFolder, () => !string.IsNullOrWhiteSpace(_s.VideosFolder));
ResetMemoryCommand = new RelayCommand(() => MemoryBudget = MemoryAuto, () => !IsMemoryAuto);
ResetParallelismCommand = new RelayCommand(() =>
{
@@ -400,6 +409,11 @@ public sealed class SettingsViewModel : SectionViewModel
public EditableField FileTemplate { get; }
public ICommand BrowseArchiveCommand { get; }
/// <summary>Archive › Videos folder: where Videos › Copy to folder puts copies of renders.</summary>
public EditableField VideosFolder { get; }
public ICommand BrowseVideosCommand { get; }
public ICommand OpenVideosFolderCommand { get; }
/// <summary>"1.8 TB free".</summary>
public string? ArchiveFreeText
{
@@ -1236,7 +1250,7 @@ public sealed class SettingsViewModel : SectionViewModel
JobKind.Render, JobKind.Import, JobKind.Download, JobKind.UploadCommit, JobKind.Scan, JobKind.Rebuild, JobKind.Verify, JobKind.LightAnalyse,
JobKind.DeepAnalyse, JobKind.Thumbs, JobKind.Proxies, JobKind.Maintenance, JobKind.Duplicates, JobKind.Orphans, JobKind.Adopt, JobKind.Move,
JobKind.Backup, JobKind.Cleanup, JobKind.EmptyTrash, JobKind.Convert, JobKind.WorkspaceCopy, JobKind.WorkspaceRender, JobKind.WorkspaceSend,
JobKind.WorkspaceMove,
JobKind.WorkspaceMove, JobKind.VideoCopy,
];
/// <summary>Stores <paramref name="level"/> for <paramref name="kind"/>, keeping only the levels that differ from the defaults.</summary>
@@ -1259,6 +1273,28 @@ public sealed class SettingsViewModel : SectionViewModel
? null
: Loc.L("Errors.Number.DecimalRange", min.ToString("0.##", Loc.Culture), max.ToString("0.##", Loc.Culture));
/// <summary>Empty leaves the videos folder unset; a path must be absolute and outside the archive and the workspace.</summary>
private string? ValidateVideosFolder(string text) =>
text.Trim().Length == 0 ? null
: VideosFolders.Problem(text.Trim(), _s.LastArchivePath, Shell.Services.Workspace.Root) is { } problem ? VideoText.FolderReason(problem) : null;
/// <summary>Opens the videos folder in Explorer, creating it first (it is Chronos's own folder for copies).</summary>
private void OpenVideosFolder()
{
if (string.IsNullOrWhiteSpace(_s.VideosFolder)) return;
try
{
Directory.CreateDirectory(_s.VideosFolder);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or NotSupportedException)
{
Log.Warning("settings", $"The videos folder could not be created: {ex.Message}");
Shell.Notify(Loc.L("Errors.Videos.FolderCreate", _s.VideosFolder), ErrorText.For(ex), isError: true);
return;
}
ShellActions.Reveal(_s.VideosFolder);
}
private void Browse(EditableField field, string titleKey)
{
var folder = Shell.Services.Dialogs.PickFolder(Loc.L(titleKey), field.Value.Length > 0 ? field.Value : null);
@@ -1620,8 +1656,10 @@ public sealed class SettingsViewModel : SectionViewModel
_s.FileTemplate = defaults.FileTemplate;
_s.ProxyLongEdge = defaults.ProxyLongEdge;
_s.ThumbnailLongEdge = defaults.ThumbnailLongEdge;
_s.VideosFolder = defaults.VideosFolder;
FolderTemplate.Load(_s.FolderTemplate);
FileTemplate.Load(_s.FileTemplate);
VideosFolder.Load(_s.VideosFolder ?? string.Empty);
UpdatePreview();
Save();
OnAllPropertiesChanged();
@@ -1682,6 +1720,7 @@ public sealed class SettingsViewModel : SectionViewModel
ArchiveRoot.Load(_s.LastArchivePath ?? string.Empty);
FolderTemplate.Load(_s.FolderTemplate);
FileTemplate.Load(_s.FileTemplate);
VideosFolder.Load(_s.VideosFolder ?? string.Empty);
LoadImportFields();
LoadAnalysisFields();
Parallelism.Load(EffectiveParallelism.ToString(CultureInfo.CurrentCulture));
@@ -1765,6 +1804,7 @@ public sealed class SettingsViewModel : SectionViewModel
ArchiveRoot.Refresh();
FolderTemplate.Refresh();
FileTemplate.Refresh();
VideosFolder.Refresh();
SessionGap.Refresh();
MinimumFrames.Refresh();
// Decimals are written in the language's own way ("6.25", "6,25").