mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-06 15:58:29 +01:00
add date content added comparer
This commit is contained in:
@@ -108,7 +108,12 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
|
||||
protected Task<Stream> GetThumbCollage(List<BaseItem> items)
|
||||
{
|
||||
return DynamicImageHelpers.GetThumbCollage(items.Select(i => i.GetImagePath(ImageType.Primary) ?? i.GetImagePath(ImageType.Thumb)).ToList(),
|
||||
var files = items
|
||||
.Select(i => i.GetImagePath(ImageType.Primary) ?? i.GetImagePath(ImageType.Thumb))
|
||||
.Where(i => !string.IsNullOrWhiteSpace(i))
|
||||
.ToList();
|
||||
|
||||
return DynamicImageHelpers.GetThumbCollage(files,
|
||||
FileSystem,
|
||||
1600,
|
||||
900,
|
||||
@@ -117,7 +122,12 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
|
||||
protected Task<Stream> GetSquareCollage(List<BaseItem> items)
|
||||
{
|
||||
return DynamicImageHelpers.GetSquareCollage(items.Select(i => i.GetImagePath(ImageType.Primary) ?? i.GetImagePath(ImageType.Thumb)).ToList(),
|
||||
var files = items
|
||||
.Select(i => i.GetImagePath(ImageType.Primary) ?? i.GetImagePath(ImageType.Thumb))
|
||||
.Where(i => !string.IsNullOrWhiteSpace(i))
|
||||
.ToList();
|
||||
|
||||
return DynamicImageHelpers.GetSquareCollage(files,
|
||||
FileSystem,
|
||||
800, ApplicationPaths);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using MediaBrowser.Common.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Photos
|
||||
@@ -15,6 +16,11 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
int width,
|
||||
int height, IApplicationPaths appPaths)
|
||||
{
|
||||
if (files.Any(string.IsNullOrWhiteSpace))
|
||||
{
|
||||
throw new ArgumentException("Empty file found in files list");
|
||||
}
|
||||
|
||||
if (files.Count < 3)
|
||||
{
|
||||
return await GetSingleImage(files, fileSystem).ConfigureAwait(false);
|
||||
@@ -27,7 +33,7 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
int cellHeight = height;
|
||||
var index = 0;
|
||||
|
||||
using (var wand = new MagickWand(width, height, "transparent"))
|
||||
using (var wand = new MagickWand(width, height, new PixelWand(ColorName.None, 1)))
|
||||
{
|
||||
for (var row = 0; row < rows; row++)
|
||||
{
|
||||
@@ -57,6 +63,11 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
IFileSystem fileSystem,
|
||||
int size, IApplicationPaths appPaths)
|
||||
{
|
||||
if (files.Any(string.IsNullOrWhiteSpace))
|
||||
{
|
||||
throw new ArgumentException("Empty file found in files list");
|
||||
}
|
||||
|
||||
if (files.Count < 4)
|
||||
{
|
||||
return await GetSingleImage(files, fileSystem).ConfigureAwait(false);
|
||||
@@ -68,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
int singleSize = size / 2;
|
||||
var index = 0;
|
||||
|
||||
using (var wand = new MagickWand(size, size, "transparent"))
|
||||
using (var wand = new MagickWand(size, size, new PixelWand(ColorName.None, 1)))
|
||||
{
|
||||
for (var row = 0; row < rows; row++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user