You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
46 lines
1.5 KiB
6 years ago
|
using System.Collections.Generic;
|
||
6 years ago
|
using MediaBrowser.Controller.Entities;
|
||
11 years ago
|
using MediaBrowser.Controller.Providers;
|
||
8 years ago
|
using MediaBrowser.Model.IO;
|
||
11 years ago
|
|
||
11 years ago
|
namespace MediaBrowser.LocalMetadata.Images
|
||
11 years ago
|
{
|
||
5 years ago
|
/// <summary>
|
||
|
/// Collection folder local image provider.
|
||
|
/// </summary>
|
||
5 years ago
|
public class CollectionFolderLocalImageProvider : ILocalImageProvider, IHasOrder
|
||
11 years ago
|
{
|
||
10 years ago
|
private readonly IFileSystem _fileSystem;
|
||
|
|
||
5 years ago
|
/// <summary>
|
||
|
/// Initializes a new instance of the <see cref="CollectionFolderLocalImageProvider"/> class.
|
||
|
/// </summary>
|
||
|
/// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
|
||
10 years ago
|
public CollectionFolderLocalImageProvider(IFileSystem fileSystem)
|
||
|
{
|
||
|
_fileSystem = fileSystem;
|
||
|
}
|
||
|
|
||
5 years ago
|
/// <inheritdoc />
|
||
6 years ago
|
public string Name => "Collection Folder Images";
|
||
11 years ago
|
|
||
5 years ago
|
/// Run after LocalImageProvider
|
||
|
/// <inheritdoc />
|
||
|
public int Order => 1;
|
||
|
|
||
|
/// <inheritdoc />
|
||
6 years ago
|
public bool Supports(BaseItem item)
|
||
11 years ago
|
{
|
||
11 years ago
|
return item is CollectionFolder && item.SupportsLocalMetadata;
|
||
11 years ago
|
}
|
||
|
|
||
5 years ago
|
/// <inheritdoc />
|
||
6 years ago
|
public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService)
|
||
11 years ago
|
{
|
||
|
var collectionFolder = (CollectionFolder)item;
|
||
|
|
||
5 years ago
|
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryService);
|
||
11 years ago
|
}
|
||
|
}
|
||
|
}
|