aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/FanartBaseProvider.cs
blob: dcab79717ad078ca0f4777328804d0514ee40ea0 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using System.Collections.Generic;
using System.Threading;

namespace MediaBrowser.Providers
{
    /// <summary>
    /// Class FanartBaseProvider
    /// </summary>
    public abstract class FanartBaseProvider : BaseMetadataProvider
    {
        internal static readonly SemaphoreSlim FanArtResourcePool = new SemaphoreSlim(3, 3);

        /// <summary>
        /// The LOG o_ FILE
        /// </summary>
        protected const string LogoFile = "logo.png";

        /// <summary>
        /// The AR t_ FILE
        /// </summary>
        protected const string ArtFile = "clearart.png";

        /// <summary>
        /// The THUM b_ FILE
        /// </summary>
        protected const string ThumbFile = "thumb.jpg";

        /// <summary>
        /// The DIS c_ FILE
        /// </summary>
        protected const string DiscFile = "disc.png";

        /// <summary>
        /// The BANNE r_ FILE
        /// </summary>
        protected const string BannerFile = "banner.png";

        /// <summary>
        /// The Backdrop
        /// </summary>
        protected const string BackdropFile = "backdrop.jpg";

        /// <summary>
        /// The Primary image
        /// </summary>
        protected const string PrimaryFile = "folder.jpg";

        /// <summary>
        /// The API key
        /// </summary>
        internal const string ApiKey = "5c6b04c68e904cfed1e6cbc9a9e683d4";

        protected FanartBaseProvider(ILogManager logManager, IServerConfigurationManager configurationManager)
            : base(logManager, configurationManager)
        {
        }

        /// <summary>
        /// Gets a value indicating whether [requires internet].
        /// </summary>
        /// <value><c>true</c> if [requires internet]; otherwise, <c>false</c>.</value>
        public override bool RequiresInternet
        {
            get { return true; }
        }

        /// <summary>
        /// Gets the priority.
        /// </summary>
        /// <value>The priority.</value>
        public override MetadataProviderPriority Priority
        {
            get { return MetadataProviderPriority.Third; }
        }

        #region Result Objects

        protected class FanArtImageInfo
        {
            public string id { get; set; }
            public string url { get; set; }
            public string likes { get; set; }
        }

        protected class FanArtMusicInfo
        {
            public string mbid_id { get; set; }
            public List<FanArtImageInfo> musiclogo { get; set; }
            public List<FanArtImageInfo> artistbackground { get; set; }
            public List<FanArtImageInfo> artistthumb { get; set; }
            public List<FanArtImageInfo> hdmusiclogo { get; set; }
            public List<FanArtImageInfo> musicbanner { get; set; }
        }

        protected class FanArtMusicResult
        {
            public FanArtMusicInfo result { get; set; }
        }

        #endregion

    }

}