From d976f13970e034a24c1d0f69384501e31475a127 Mon Sep 17 00:00:00 2001 From: Tim Eisele Date: Mon, 5 May 2025 05:21:44 +0200 Subject: Recognize file changes and remove data on change (#13839) --- .../Library/KeyframeManager.cs | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Emby.Server.Implementations/Library/KeyframeManager.cs (limited to 'Emby.Server.Implementations/Library/KeyframeManager.cs') diff --git a/Emby.Server.Implementations/Library/KeyframeManager.cs b/Emby.Server.Implementations/Library/KeyframeManager.cs new file mode 100644 index 000000000..18f4ce047 --- /dev/null +++ b/Emby.Server.Implementations/Library/KeyframeManager.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Jellyfin.MediaEncoding.Keyframes; +using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.Persistence; + +namespace Emby.Server.Implementations.Library; + +/// +/// Manager for Keyframe data. +/// +public class KeyframeManager : IKeyframeManager +{ + private readonly IKeyframeRepository _repository; + + /// + /// Initializes a new instance of the class. + /// + /// The keyframe repository. + public KeyframeManager(IKeyframeRepository repository) + { + _repository = repository; + } + + /// + public IReadOnlyList GetKeyframeData(Guid itemId) + { + return _repository.GetKeyframeData(itemId); + } + + /// + public async Task SaveKeyframeDataAsync(Guid itemId, KeyframeData data, CancellationToken cancellationToken) + { + await _repository.SaveKeyframeDataAsync(itemId, data, cancellationToken).ConfigureAwait(false); + } + + /// + public async Task DeleteKeyframeDataAsync(Guid itemId, CancellationToken cancellationToken) + { + await _repository.DeleteKeyframeDataAsync(itemId, cancellationToken).ConfigureAwait(false); + } +} -- cgit v1.2.3