aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/ILocalImageProvider.cs
blob: 5c3ebd9acfad3c323b04397bc8cdd345a3910307 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Controller.Providers
{
    /// <summary>
    /// This is just a marker interface
    /// </summary>
    public interface ILocalImageProvider : IImageProvider
    {
    }

    public interface IImageFileProvider : ILocalImageProvider
    {
        List<LocalImageInfo> GetImages(IHasImages item);
    }

    public class LocalImageInfo
    {
        public string Path { get; set; }
        public ImageType Type { get; set; }
    }

    public interface IDynamicImageProvider : ILocalImageProvider
    {
        /// <summary>
        /// Gets the supported images.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns>IEnumerable{ImageType}.</returns>
        IEnumerable<ImageType> GetSupportedImages(IHasImages item);

        /// <summary>
        /// Gets the image.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="type">The type.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>Task{DynamicImageResponse}.</returns>
        Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken);
    }

    public class DynamicImageInfo
    {
        public string ImageId { get; set; }
        public ImageType Type { get; set; }
    }

    public class DynamicImageResponse
    {
        public string Path { get; set; }
        public Stream Stream { get; set; }
        public ImageFormat Format { get; set; }
        public bool HasImage { get; set; }

        public void SetFormatFromMimeType(string mimeType)
        {
            
        }
    }
}