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