using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
namespace MediaBrowser.LocalMetadata.Images
{
///
/// Collection folder local image provider.
///
public class CollectionFolderLocalImageProvider : ILocalImageProvider, IHasOrder
{
private readonly IFileSystem _fileSystem;
///
/// Initializes a new instance of the class.
///
/// Instance of the interface.
public CollectionFolderLocalImageProvider(IFileSystem fileSystem)
{
_fileSystem = fileSystem;
}
///
public string Name => "Collection Folder Images";
/// Run after LocalImageProvider
///
public int Order => 1;
///
public bool Supports(BaseItem item)
{
return item is CollectionFolder && item.SupportsLocalMetadata;
}
///
public List GetImages(BaseItem item, IDirectoryService directoryService)
{
var collectionFolder = (CollectionFolder)item;
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryService);
}
}
}