jellyfin/MediaBrowser.LocalMetadata/Images/CollectionFolderImageProvider.cs

35 lines
1.0 KiB
C#
Raw Normal View History

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