Implement animated previews and perceptual hashing in PLib video library manager. Introduce IAnimatedPreviewGenerator and IVideoPerceptualHasher interfaces, enhancing video item metadata with animated preview paths and perceptual hashes. Update LibraryService to manage indexing in three passes: metadata, animated previews, and perceptual hashes. Revise UI components to display animated previews and manage duplicate video detection. Enhance README.md to document these new features and usage instructions.

This commit is contained in:
Leonid Pershin
2026-08-09 07:48:45 +03:00
parent 10c66baea8
commit 3c77baced7
36 changed files with 2711 additions and 471 deletions
@@ -28,6 +28,18 @@ public interface ILibraryService
/// <summary>Remembers where playback stopped so the video can be resumed later.</summary>
Task SaveProgressAsync(Guid videoId, TimeSpan position, CancellationToken cancellationToken = default);
/// <summary>
/// Groups of videos that look alike, by perceptual hash. Videos without a hash, and
/// groups of one, are left out.
/// </summary>
/// <param name="maxDistance">
/// How many differing bits still count as the same video. Zero means visually identical;
/// the useful range for re-encodes is a handful of bits.
/// </param>
Task<IReadOnlyList<IReadOnlyList<VideoItem>>> FindDuplicatesAsync(
int maxDistance,
CancellationToken cancellationToken = default);
/// <summary>One video with its labels loaded, or <c>null</c> if it is gone.</summary>
Task<VideoItem?> GetVideoWithLabelsAsync(Guid videoId, CancellationToken cancellationToken = default);