Implement theme management and settings dialog in PLib video library manager. Add theme service for light/dark/system themes, integrate settings dialog for user preferences, and update app configuration to include appearance options. Enhance thumbnail caching with new methods for cache size and clearing. Update README.md to reflect new features and settings.

This commit is contained in:
Leonid Pershin
2026-08-08 12:04:53 +03:00
parent 625eae7ead
commit 37c5feb2a6
24 changed files with 1099 additions and 185 deletions
@@ -90,6 +90,18 @@ public sealed class FfmpegThumbnailGenerator(
CancellationToken cancellationToken = default) =>
Task.Run(() => Purge(inUsePaths, cancellationToken), cancellationToken);
public Task<long> GetCacheSizeInBytesAsync(CancellationToken cancellationToken = default) =>
Task.Run(
() => Directory.Exists(paths.ThumbnailDirectory)
? new DirectoryInfo(paths.ThumbnailDirectory).EnumerateFiles().Sum(file => file.Length)
: 0L,
cancellationToken);
public Task<int> ClearAsync(CancellationToken cancellationToken = default) =>
// Nothing is in use, so every frame is garbage — the purge already knows how to do
// this safely, including leaving another instance's in-flight renders alone.
PurgeUnusedAsync([], cancellationToken);
private int Purge(IReadOnlyCollection<string> inUsePaths, CancellationToken cancellationToken)
{
if (!Directory.Exists(paths.ThumbnailDirectory))