jellyfin/MediaBrowser.LocalMetadata/Images/CollectionFolderImageProvider.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2014-07-26 17:30:15 +00:00
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Entities;
2014-02-08 20:02:35 +00:00
using MediaBrowser.Controller.Providers;
2014-07-26 17:30:15 +00:00
using System.Collections.Generic;
2015-10-04 04:23:11 +00:00
using CommonIO;
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;
}
2014-02-08 20:02:35 +00:00
public string Name
{
get { return "Collection Folder Images"; }
}
public bool Supports(IHasImages item)
{
2014-02-10 20:11:46 +00:00
return item is CollectionFolder && item.SupportsLocalMetadata;
2014-02-08 20:02:35 +00:00
}
public int Order
{
get
{
// Run after LocalImageProvider
return 1;
}
}
2014-02-10 18:39:41 +00:00
public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
2014-02-08 20:02:35 +00:00
{
var collectionFolder = (CollectionFolder)item;
2015-10-30 16:45:22 +00:00
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryService);
2014-02-08 20:02:35 +00:00
}
}
}