| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Threading; |
| | | 4 | | using System.Threading.Tasks; |
| | | 5 | | using Jellyfin.MediaEncoding.Keyframes; |
| | | 6 | | using MediaBrowser.Controller.IO; |
| | | 7 | | using MediaBrowser.Controller.Persistence; |
| | | 8 | | |
| | | 9 | | namespace Emby.Server.Implementations.Library; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Manager for Keyframe data. |
| | | 13 | | /// </summary> |
| | | 14 | | public class KeyframeManager : IKeyframeManager |
| | | 15 | | { |
| | | 16 | | private readonly IKeyframeRepository _repository; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Initializes a new instance of the <see cref="KeyframeManager"/> class. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <param name="repository">The keyframe repository.</param> |
| | | 22 | | public KeyframeManager(IKeyframeRepository repository) |
| | | 23 | | { |
| | 21 | 24 | | _repository = repository; |
| | 21 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <inheritdoc /> |
| | | 28 | | public IReadOnlyList<KeyframeData> GetKeyframeData(Guid itemId) |
| | | 29 | | { |
| | 0 | 30 | | return _repository.GetKeyframeData(itemId); |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | /// <inheritdoc /> |
| | | 34 | | public async Task SaveKeyframeDataAsync(Guid itemId, KeyframeData data, CancellationToken cancellationToken) |
| | | 35 | | { |
| | | 36 | | await _repository.SaveKeyframeDataAsync(itemId, data, cancellationToken).ConfigureAwait(false); |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <inheritdoc /> |
| | | 40 | | public async Task DeleteKeyframeDataAsync(Guid itemId, CancellationToken cancellationToken) |
| | | 41 | | { |
| | | 42 | | await _repository.DeleteKeyframeDataAsync(itemId, cancellationToken).ConfigureAwait(false); |
| | | 43 | | } |
| | | 44 | | } |