2016-03-27 14:11:27 -07:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2014-02-08 13:02:35 -07:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2014-07-26 10:30:15 -07:00
|
|
|
|
using System.Collections.Generic;
|
2016-10-25 12:02:04 -07:00
|
|
|
|
using MediaBrowser.Common.IO;
|
|
|
|
|
using MediaBrowser.Controller.IO;
|
|
|
|
|
using MediaBrowser.Model.IO;
|
2014-02-08 13:02:35 -07:00
|
|
|
|
|
2014-06-29 20:04:50 -07:00
|
|
|
|
namespace MediaBrowser.LocalMetadata.Images
|
2014-02-08 13:02:35 -07:00
|
|
|
|
{
|
|
|
|
|
public class CollectionFolderLocalImageProvider : ILocalImageFileProvider, IHasOrder
|
|
|
|
|
{
|
2014-07-26 10:30:15 -07:00
|
|
|
|
private readonly IFileSystem _fileSystem;
|
|
|
|
|
|
|
|
|
|
public CollectionFolderLocalImageProvider(IFileSystem fileSystem)
|
|
|
|
|
{
|
|
|
|
|
_fileSystem = fileSystem;
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-08 13:02:35 -07:00
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Collection Folder Images"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Supports(IHasImages item)
|
|
|
|
|
{
|
2014-02-10 13:11:46 -07:00
|
|
|
|
return item is CollectionFolder && item.SupportsLocalMetadata;
|
2014-02-08 13:02:35 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Order
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
// Run after LocalImageProvider
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-10 11:39:41 -07:00
|
|
|
|
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
2014-02-08 13:02:35 -07:00
|
|
|
|
{
|
|
|
|
|
var collectionFolder = (CollectionFolder)item;
|
|
|
|
|
|
2017-03-28 23:26:48 -07:00
|
|
|
|
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, true, directoryService);
|
2014-02-08 13:02:35 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|