ILocalMetadataProvider.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Model.Entities;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Controller.Providers
  7. {
  8. public interface ILocalMetadataProvider : IMetadataProvider
  9. {
  10. }
  11. public interface ILocalMetadataProvider<TItemType> : IMetadataProvider<TItemType>, ILocalMetadataProvider
  12. where TItemType : IHasMetadata
  13. {
  14. /// <summary>
  15. /// Gets the metadata.
  16. /// </summary>
  17. /// <param name="info">The information.</param>
  18. /// <param name="cancellationToken">The cancellation token.</param>
  19. /// <returns>Task{MetadataResult{`0}}.</returns>
  20. Task<LocalMetadataResult<TItemType>> GetMetadata(ItemInfo info, CancellationToken cancellationToken);
  21. }
  22. public class ItemInfo
  23. {
  24. public string Path { get; set; }
  25. public bool IsInMixedFolder { get; set; }
  26. }
  27. public class LocalMetadataResult<T>
  28. where T : IHasMetadata
  29. {
  30. public bool HasMetadata { get; set; }
  31. public T Item { get; set; }
  32. public List<LocalImageInfo> Images { get; set; }
  33. public List<ChapterInfo> Chapters { get; set; }
  34. public LocalMetadataResult()
  35. {
  36. Images = new List<LocalImageInfo>();
  37. Chapters = new List<ChapterInfo>();
  38. }
  39. }
  40. }