diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-03 03:14:14 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-03 03:14:14 -0400 |
| commit | b76a1abda578b8ff64bad2997b036b0fc43e264f (patch) | |
| tree | 7b73000abcf71e90c290b6107525969cb904ed2d /Emby.Server.Implementations/Photos | |
| parent | 3eb4091808735858b01855d298226d239be464af (diff) | |
move classes to portable server lib
Diffstat (limited to 'Emby.Server.Implementations/Photos')
| -rw-r--r-- | Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.cs b/Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.cs new file mode 100644 index 000000000..cc1756f96 --- /dev/null +++ b/Emby.Server.Implementations/Photos/PhotoAlbumImageProvider.cs @@ -0,0 +1,34 @@ +using MediaBrowser.Common.Configuration; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Emby.Server.Implementations.Images; +using MediaBrowser.Model.IO; +using MediaBrowser.Model.Entities; + +namespace Emby.Server.Implementations.Photos +{ + public class PhotoAlbumImageProvider : BaseDynamicImageProvider<PhotoAlbum> + { + public PhotoAlbumImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor) + : base(fileSystem, providerManager, applicationPaths, imageProcessor) + { + } + + protected override Task<List<BaseItem>> GetItemsWithImages(IHasImages item) + { + var photoAlbum = (PhotoAlbum)item; + var items = GetFinalItems(photoAlbum.Children.ToList()); + + return Task.FromResult(items); + } + + protected override Task<string> CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex) + { + return CreateSingleImage(itemsWithImages, outputPathWithoutExtension, ImageType.Primary); + } + } +} |
