2013-05-02 22:32:15 +00:00
|
|
|
|
using MediaBrowser.Controller.Configuration;
|
2013-03-02 17:59:15 +00:00
|
|
|
|
using MediaBrowser.Model.Logging;
|
2013-05-02 22:32:15 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
2013-02-21 01:33:05 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class FanartBaseProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract class FanartBaseProvider : BaseMetadataProvider
|
|
|
|
|
{
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected static readonly SemaphoreSlim FanArtResourcePool = new SemaphoreSlim(3,3);
|
2013-03-04 15:13:03 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The LOG o_ FILE
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string LogoFile = "logo.png";
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The AR t_ FILE
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string ArtFile = "clearart.png";
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The THUM b_ FILE
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string ThumbFile = "thumb.jpg";
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The DIS c_ FILE
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string DiscFile = "disc.png";
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The BANNE r_ FILE
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string BannerFile = "banner.png";
|
2013-02-21 01:33:05 +00:00
|
|
|
|
|
2013-03-04 14:34:00 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The Backdrop
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string BackdropFile = "backdrop.jpg";
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The Primary image
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string PrimaryFile = "folder.jpg";
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The API key
|
|
|
|
|
/// </summary>
|
2013-05-19 21:20:47 +00:00
|
|
|
|
protected const string ApiKey = "5c6b04c68e904cfed1e6cbc9a9e683d4";
|
2013-02-21 01:33:05 +00:00
|
|
|
|
|
2013-03-04 05:43:06 +00:00
|
|
|
|
protected FanartBaseProvider(ILogManager logManager, IServerConfigurationManager configurationManager) : base(logManager, configurationManager)
|
2013-03-02 17:59:15 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <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
|
|
|
|
|
{
|
2013-03-04 14:34:00 +00:00
|
|
|
|
get { return true; }
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the priority.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The priority.</value>
|
|
|
|
|
public override MetadataProviderPriority Priority
|
|
|
|
|
{
|
|
|
|
|
get { return MetadataProviderPriority.Third; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-04 14:34:00 +00:00
|
|
|
|
#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
|
2013-02-21 01:33:05 +00:00
|
|
|
|
|
|
|
|
|
}
|
2013-03-04 14:34:00 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|