mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 03:48:06 +02:00
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using MediaBrowser.Common.IO;
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Providers;
|
|
using System.Collections.Generic;
|
|
using CommonIO;
|
|
|
|
namespace MediaBrowser.LocalMetadata.Images
|
|
{
|
|
public class CollectionFolderLocalImageProvider : ILocalImageFileProvider, IHasOrder
|
|
{
|
|
private readonly IFileSystem _fileSystem;
|
|
|
|
public CollectionFolderLocalImageProvider(IFileSystem fileSystem)
|
|
{
|
|
_fileSystem = fileSystem;
|
|
}
|
|
|
|
public string Name
|
|
{
|
|
get { return "Collection Folder Images"; }
|
|
}
|
|
|
|
public bool Supports(IHasImages item)
|
|
{
|
|
return item is CollectionFolder && item.SupportsLocalMetadata;
|
|
}
|
|
|
|
public int Order
|
|
{
|
|
get
|
|
{
|
|
// Run after LocalImageProvider
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
|
|
{
|
|
var collectionFolder = (CollectionFolder)item;
|
|
|
|
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryService);
|
|
}
|
|
}
|
|
}
|