2012-09-08 12:05:18 -07:00
|
|
|
|
using MediaBrowser.Controller.Library;
|
2012-08-19 08:58:35 -07:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2012-09-08 12:05:18 -07:00
|
|
|
|
using System.Threading.Tasks;
|
2012-08-19 08:58:35 -07:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
2012-09-08 12:05:18 -07:00
|
|
|
|
public abstract class BaseMetadataProvider
|
2012-08-19 08:58:35 -07:00
|
|
|
|
{
|
2012-08-19 13:38:31 -07:00
|
|
|
|
public abstract bool Supports(BaseEntity item);
|
|
|
|
|
|
|
|
|
|
public virtual bool RequiresInternet
|
2012-08-19 08:58:35 -07:00
|
|
|
|
{
|
2012-08-19 13:38:31 -07:00
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2012-08-19 08:58:35 -07:00
|
|
|
|
}
|
|
|
|
|
|
2012-08-21 19:50:59 -07:00
|
|
|
|
public abstract Task FetchAsync(BaseEntity item, ItemResolveEventArgs args);
|
2012-08-20 08:55:05 -07:00
|
|
|
|
|
|
|
|
|
public abstract MetadataProviderPriority Priority { get; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines when a provider should execute, relative to others
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum MetadataProviderPriority
|
|
|
|
|
{
|
|
|
|
|
// Run this provider at the beginning
|
2012-08-20 18:21:03 -07:00
|
|
|
|
First = 1,
|
2012-08-20 08:55:05 -07:00
|
|
|
|
|
|
|
|
|
// Run this provider after all first priority providers
|
2012-08-20 18:21:03 -07:00
|
|
|
|
Second = 2,
|
2012-08-20 08:55:05 -07:00
|
|
|
|
|
2012-08-20 12:16:51 -07:00
|
|
|
|
// Run this provider after all second priority providers
|
2012-08-20 18:21:03 -07:00
|
|
|
|
Third = 3,
|
2012-08-20 12:16:51 -07:00
|
|
|
|
|
2012-08-20 08:55:05 -07:00
|
|
|
|
// Run this provider last
|
2012-08-20 18:21:03 -07:00
|
|
|
|
Last = 4
|
2012-08-19 08:58:35 -07:00
|
|
|
|
}
|
|
|
|
|
}
|