mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-13 11:10:24 +01:00
support null image encoder
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CommonIO;
|
||||
@@ -20,9 +20,26 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
protected override Task<List<BaseItem>> GetItemsWithImages(IHasImages item)
|
||||
{
|
||||
var photoAlbum = (PhotoAlbum)item;
|
||||
var items = GetFinalItems(photoAlbum.Children.ToList());
|
||||
var items = GetFinalItems(photoAlbum.Children.ToList(), 1);
|
||||
|
||||
return Task.FromResult(items);
|
||||
}
|
||||
|
||||
protected override async Task<string> CreateImage(IHasImages item, List<BaseItem> itemsWithImages, string outputPathWithoutExtension, Model.Entities.ImageType imageType, int imageIndex)
|
||||
{
|
||||
var photoFile = itemsWithImages.Where(i => Path.HasExtension(i.Path)).Select(i => i.Path).FirstOrDefault();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(photoFile))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(photoFile);
|
||||
|
||||
var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ext);
|
||||
File.Copy(photoFile, outputPath);
|
||||
|
||||
return outputPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user