feat(settings): make every Settings row real; archive settings, index backups and restore
Settings (UI-01, UI-02, UI-03, UI-09, RF-4): - New Import, Analysis and Formats pages, in the order of Settings.html. Import holds the defaults of new cards (session rules, subfolders, verification, duplicates, after-import actions); Analysis the deep-analysis width cap, night and star-field thresholds and deep analysis after import or scan; Formats the decode tier of every format on this PC with a notice and Store install link per missing codec extension. - Archive gains thumbnail size and rescan interval; its templates, proxy size and thumbnail size are the open archive's own (archive.json) and new archives' defaults. - Rendering quality, parallelism and background priority now drive the jobs: quality maps to preparation size, read-ahead and default flow quality; parallelism sets the engine's workers live and caps per-job threads; background priority raises the UI thread while Titano is in front. - Advanced gains Restore (daily backups, dry-run summary, destructive confirmation, staged for the next start) and Reset all. - The naming preview's sample title is a catalog string. Engine (ENG-03, ENG-04, ENG-06): - ArchiveService.GetSettingsAsync/UpdateSettingsAsync rewrite archive.json atomically under a lease, then the index row; the server endpoint and the desktop use them, and the desktop creates archives with Settings › Archive. ThumbnailPolicy in archive.json sizes the thumbnails. - DatabaseBackups: daily VACUUM INTO copies kept x3 on the desktop and on a server on SQLite (DatabaseBackupService), staged restore checked and preceded by a fresh copy. - Maintenance vacuums the SQLite index when 10 % or more is free (dry run reports it). - JobEngine.SetWorkers; ProcessingOptions.Tune applies host tuning per job. Archive setup toasts say why in a localized sentence (RF-1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
91 files changed
+2864
-357
No files matched your search
@@ -19,8 +19,20 @@ public sealed record ArchiveManifest
|
||||
public LayoutTemplates LayoutTemplates { get; init; } = new();
|
||||
public ProxyPolicy ProxyPolicy { get; init; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// The default policy when absent: archives written before it existed have none, and the source-generated reader
|
||||
/// sets an init-only property it does not find to null rather than keeping its initializer.
|
||||
/// </summary>
|
||||
public ThumbnailPolicy ThumbnailPolicy
|
||||
{
|
||||
get => _thumbnailPolicy;
|
||||
init => _thumbnailPolicy = value ?? new ThumbnailPolicy();
|
||||
}
|
||||
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement>? Extra { get; set; }
|
||||
|
||||
private readonly ThumbnailPolicy _thumbnailPolicy = new();
|
||||
}
|
||||
|
||||
/// <summary>Naming templates used when frames enter the archive (BRIEF §7.1).</summary>
|
||||
@@ -46,4 +58,39 @@ public sealed record ProxyPolicy
|
||||
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement>? Extra { get; set; }
|
||||
|
||||
/// <summary>True for the long edges an archive accepts: disabled, full size, or 256 to 8192 px.</summary>
|
||||
public static bool IsValidLongEdge(int longEdge) => longEdge is Disabled or FullSize or (>= 256 and <= 8192);
|
||||
}
|
||||
|
||||
/// <summary>Thumbnail policy (BRIEF §8.5): long edge and JPEG quality of the thumbnails packed per sequence.</summary>
|
||||
public sealed record ThumbnailPolicy
|
||||
{
|
||||
public const int MinLongEdge = 160;
|
||||
public const int MaxLongEdge = 1024;
|
||||
|
||||
/// <summary>
|
||||
/// Long edge in pixels (320 by default); thumbnails built before a change keep their size until rebuilt. A value the
|
||||
/// file lacks (read as 0) is the default.
|
||||
/// </summary>
|
||||
public int LongEdge
|
||||
{
|
||||
get => _longEdge;
|
||||
init => _longEdge = value > 0 ? value : FrameImageRenderer.ThumbnailLongEdge;
|
||||
}
|
||||
|
||||
/// <summary>JPEG quality (80 by default); a value the file lacks (read as 0) or out of 1–100 is the default.</summary>
|
||||
public int Quality
|
||||
{
|
||||
get => _quality;
|
||||
init => _quality = value is > 0 and <= 100 ? value : FrameImageRenderer.ThumbnailQuality;
|
||||
}
|
||||
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement>? Extra { get; set; }
|
||||
|
||||
private readonly int _longEdge = FrameImageRenderer.ThumbnailLongEdge;
|
||||
private readonly int _quality = FrameImageRenderer.ThumbnailQuality;
|
||||
|
||||
public static bool IsValidLongEdge(int longEdge) => longEdge is >= MinLongEdge and <= MaxLongEdge;
|
||||
}
|
||||
@@ -17,12 +17,16 @@ public sealed class FrameImageRenderer(ImageDecoder decoder)
|
||||
public const int ThumbnailQuality = 80;
|
||||
|
||||
/// <summary>A 320 px q80 thumbnail, or null when no decoder can read the frame.</summary>
|
||||
public EncodedImage? Thumbnail(SequencePaths sequence, SidecarFrame frame, CancellationToken cancellationToken = default)
|
||||
public EncodedImage? Thumbnail(SequencePaths sequence, SidecarFrame frame, CancellationToken cancellationToken = default) =>
|
||||
Thumbnail(sequence, frame, new ThumbnailPolicy(), cancellationToken);
|
||||
|
||||
/// <summary>A thumbnail at the policy's long edge and quality (the archive's, BRIEF §8.5), or null when no decoder can read the frame.</summary>
|
||||
public EncodedImage? Thumbnail(SequencePaths sequence, SidecarFrame frame, ThumbnailPolicy policy, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var decoded = Decode(sequence.File(frame.File), frame, ThumbnailLongEdge, DecodePurpose.Thumbnail, preferPreview: true, cancellationToken);
|
||||
using var decoded = Decode(sequence.File(frame.File), frame, policy.LongEdge, DecodePurpose.Thumbnail, preferPreview: true, cancellationToken);
|
||||
if (decoded is null) return null;
|
||||
using var small = Resampler.Thumbnail(decoded.Pixels, ThumbnailLongEdge);
|
||||
return Encode(small, new JpegEncodeOptions { Quality = ThumbnailQuality }, decoded.Tier);
|
||||
using var small = Resampler.Thumbnail(decoded.Pixels, policy.LongEdge);
|
||||
return Encode(small, new JpegEncodeOptions { Quality = policy.Quality }, decoded.Tier);
|
||||
}
|
||||
|
||||
/// <summary>A proxy at the policy's long edge and quality with capture time and camera in its Exif; null when undecodable.</summary>
|
||||
|
||||
@@ -43,6 +43,9 @@ public sealed record RenderOptions
|
||||
/// <summary>Prepared (exposure-corrected, warped) frames kept for flow and interpolation neighbours (at least 3).</summary>
|
||||
public int CacheFrames { get; init; } = 4;
|
||||
|
||||
/// <summary>Optical-flow quality of a project that neither the user nor the advisor set (the host's quality profile).</summary>
|
||||
public FlowQualitySetting DefaultFlowQuality { get; init; } = FlowQualitySetting.Balanced;
|
||||
|
||||
public RenderPlanOptions Plan { get; init; } = RenderPlanOptions.Default;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ internal sealed class RenderRun : IDisposable
|
||||
}
|
||||
var motion = input.Project.Motion;
|
||||
_targetShutter = double.Clamp(motion.TargetShutterAngle.Resolve(180.0), 0, 360);
|
||||
_flowQuality = motion.FlowQuality.Resolve(FlowQualitySetting.Balanced) switch
|
||||
_flowQuality = motion.FlowQuality.Resolve(options.DefaultFlowQuality) switch
|
||||
{
|
||||
FlowQualitySetting.Draft => FlowQuality.Draft,
|
||||
FlowQualitySetting.Best => FlowQuality.Best,
|
||||
|
||||
Reference in new issue
Block a user