KeyframeManager.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. namespace Emby.Server.Implementations.Library;
  9. /// <summary>
  10. /// Manager for Keyframe data.
  11. /// </summary>
  12. public class KeyframeManager : IKeyframeManager
  13. {
  14. private readonly IKeyframeRepository _repository;
  15. /// <summary>
  16. /// Initializes a new instance of the <see cref="KeyframeManager"/> class.
  17. /// </summary>
  18. /// <param name="repository">The keyframe repository.</param>
  19. public KeyframeManager(IKeyframeRepository repository)
  20. {
  21. _repository = repository;
  22. }
  23. /// <inheritdoc />
  24. public IReadOnlyList<KeyframeData> GetKeyframeData(Guid itemId)
  25. {
  26. return _repository.GetKeyframeData(itemId);
  27. }
  28. /// <inheritdoc />
  29. public async Task SaveKeyframeDataAsync(Guid itemId, KeyframeData data, CancellationToken cancellationToken)
  30. {
  31. await _repository.SaveKeyframeDataAsync(itemId, data, cancellationToken).ConfigureAwait(false);
  32. }
  33. /// <inheritdoc />
  34. public async Task DeleteKeyframeDataAsync(Guid itemId, CancellationToken cancellationToken)
  35. {
  36. await _repository.DeleteKeyframeDataAsync(itemId, cancellationToken).ConfigureAwait(false);
  37. }
  38. }