jellyfin/MediaBrowser.LocalMetadata/Images/CollectionFolderLocalImageProvider.cs

46 lines
1.5 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
2014-02-08 13:02:35 -07:00
using MediaBrowser.Controller.Providers;
2016-10-25 12:02:04 -07:00
using MediaBrowser.Model.IO;
2014-02-08 13:02:35 -07:00
namespace MediaBrowser.LocalMetadata.Images
2014-02-08 13:02:35 -07:00
{
/// <summary>
/// Collection folder local image provider.
/// </summary>
2020-03-09 08:10:02 -07:00
public class CollectionFolderLocalImageProvider : ILocalImageProvider, IHasOrder
2014-02-08 13:02:35 -07:00
{
2014-07-26 10:30:15 -07:00
private readonly IFileSystem _fileSystem;
/// <summary>
/// Initializes a new instance of the <see cref="CollectionFolderLocalImageProvider"/> class.
/// </summary>
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
2014-07-26 10:30:15 -07:00
public CollectionFolderLocalImageProvider(IFileSystem fileSystem)
{
_fileSystem = fileSystem;
}
/// <inheritdoc />
public string Name => "Collection Folder Images";
2014-02-08 13:02:35 -07:00
/// Run after LocalImageProvider
/// <inheritdoc />
public int Order => 1;
/// <inheritdoc />
2018-09-12 10:26:21 -07:00
public bool Supports(BaseItem item)
2014-02-08 13:02:35 -07:00
{
2014-02-10 13:11:46 -07:00
return item is CollectionFolder && item.SupportsLocalMetadata;
2014-02-08 13:02:35 -07:00
}
/// <inheritdoc />
2018-09-12 10:26:21 -07:00
public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService)
2014-02-08 13:02:35 -07:00
{
var collectionFolder = (CollectionFolder)item;
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryService);
2014-02-08 13:02:35 -07:00
}
}
}