| | 1 | | using System.Collections.Generic; |
| | 2 | | using MediaBrowser.Controller.Entities; |
| | 3 | | using MediaBrowser.Controller.Providers; |
| | 4 | | using MediaBrowser.Model.IO; |
| | 5 | |
|
| | 6 | | namespace MediaBrowser.LocalMetadata.Images |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Collection folder local image provider. |
| | 10 | | /// </summary> |
| | 11 | | public class CollectionFolderLocalImageProvider : ILocalImageProvider, IHasOrder |
| | 12 | | { |
| | 13 | | private readonly IFileSystem _fileSystem; |
| | 14 | |
|
| | 15 | | /// <summary> |
| | 16 | | /// Initializes a new instance of the <see cref="CollectionFolderLocalImageProvider"/> class. |
| | 17 | | /// </summary> |
| | 18 | | /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param> |
| | 19 | | public CollectionFolderLocalImageProvider(IFileSystem fileSystem) |
| | 20 | | { |
| 21 | 21 | | _fileSystem = fileSystem; |
| 21 | 22 | | } |
| | 23 | |
|
| | 24 | | /// <inheritdoc /> |
| 16 | 25 | | public string Name => "Collection Folder Images"; |
| | 26 | |
|
| | 27 | | /// Run after LocalImageProvider |
| | 28 | | /// <inheritdoc /> |
| 16 | 29 | | public int Order => 1; |
| | 30 | |
|
| | 31 | | /// <inheritdoc /> |
| | 32 | | public bool Supports(BaseItem item) |
| | 33 | | { |
| 53 | 34 | | return item is CollectionFolder && item.SupportsLocalMetadata; |
| | 35 | | } |
| | 36 | |
|
| | 37 | | /// <inheritdoc /> |
| | 38 | | public IEnumerable<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService) |
| | 39 | | { |
| 16 | 40 | | var collectionFolder = (CollectionFolder)item; |
| | 41 | |
|
| 16 | 42 | | return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryServ |
| | 43 | | } |
| | 44 | | } |
| | 45 | | } |