Implement metadata management features in PLib video library manager. Introduce functionality to query and apply metadata from external sources based on video fingerprints. Update ILibraryService and LibraryService to support metadata lookup and application, enhancing video item descriptions and labels. Revise UI components in VideoPlayerView and SettingsView to facilitate user interaction with metadata sources. Update README.md to document new metadata features and usage instructions.

This commit is contained in:
Leonid Pershin
2026-08-09 08:18:40 +03:00
parent c41a458d0b
commit eb4894428b
31 changed files with 1442 additions and 194 deletions
@@ -0,0 +1,26 @@
using Microsoft.Extensions.Options;
using PLib.Application.Metadata;
namespace PLib.Tests.Library;
/// <summary>
/// A fixed <see cref="IOptionsMonitor{T}"/> over metadata sources.
/// </summary>
/// <remarks>
/// The service reads <c>CurrentValue</c> on every lookup, because the user can add a source
/// without restarting. A substitute would answer null and blow up in the one place that
/// matters, so the tests hand it a real value instead.
/// </remarks>
internal sealed class MetadataMonitor(MetadataOptions value) : IOptionsMonitor<MetadataOptions>
{
public static MetadataMonitor Empty { get; } = new(new MetadataOptions());
public static MetadataMonitor With(params MetadataSourceOptions[] sources) =>
new(new MetadataOptions { Sources = [.. sources] });
public MetadataOptions CurrentValue { get; } = value;
public MetadataOptions Get(string? name) => CurrentValue;
public IDisposable? OnChange(Action<MetadataOptions, string?> listener) => null;
}