using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Providers
{
///
/// Provides local trailers by checking the trailers subfolder
///
[Export(typeof(BaseMetadataProvider))]
public class LocalTrailerProvider : BaseMetadataProvider
{
public override bool Supports(BaseEntity item)
{
return item is BaseItem;
}
public override MetadataProviderPriority Priority
{
get { return MetadataProviderPriority.First; }
}
public async override Task FetchAsync(BaseEntity item, ItemResolveEventArgs args)
{
if (args.ContainsFolder("trailers"))
{
List