aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs
blob: 1320db67a01f37ec45589c5219e5a571697a44ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Controller.Providers
{
    public interface ILocalMetadataProvider : IMetadataProvider
    {
    }

    public interface ILocalMetadataProvider<TItemType> : IMetadataProvider<TItemType>, ILocalMetadataProvider
         where TItemType : IHasMetadata
    {
        /// <summary>
        /// Gets the metadata.
        /// </summary>
        /// <param name="info">The information.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task{MetadataResult{`0}}.</returns>
        Task<LocalMetadataResult<TItemType>> GetMetadata(ItemInfo info, CancellationToken cancellationToken);
    }

    public class ItemInfo
    {
        public string Path { get; set; }

        public bool IsInMixedFolder { get; set; }
    }

    public class LocalMetadataResult<T>
        where T : IHasMetadata
    {
        public bool HasMetadata { get; set; }
        public T Item { get; set; }
        
        public List<LocalImageInfo> Images { get; set; }
        public List<ChapterInfo> Chapters { get; set; }

        public LocalMetadataResult()
        {
            Images = new List<LocalImageInfo>();
            Chapters = new List<ChapterInfo>();
        }
    }
}