mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
update indexedDb
This commit is contained in:
@@ -103,7 +103,7 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
return parts.GetMD5().ToString("N");
|
||||
}
|
||||
|
||||
protected Task CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText)
|
||||
protected Task<bool> CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, 960, 540, drawText, primaryItem.Name);
|
||||
}
|
||||
@@ -115,22 +115,22 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
.Where(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
protected Task CreatePosterCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
|
||||
protected Task<bool> CreatePosterCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, 600, 900, true, primaryItem.Name);
|
||||
}
|
||||
|
||||
protected Task CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText)
|
||||
protected Task<bool> CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, 800, 800, drawText, primaryItem.Name);
|
||||
}
|
||||
|
||||
protected Task CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text)
|
||||
protected Task<bool> CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text)
|
||||
{
|
||||
return CreateCollage(primaryItem, items, outputPath, width, height, drawText, text);
|
||||
}
|
||||
|
||||
private Task CreateCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text)
|
||||
private Task<bool> CreateCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text)
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
@@ -143,7 +143,13 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
InputPaths = GetStripCollageImagePaths(primaryItem, items).ToArray()
|
||||
};
|
||||
|
||||
return ImageProcessor.CreateImageCollage(options);
|
||||
if (options.InputPaths.Length == 0)
|
||||
{
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
ImageProcessor.CreateImageCollage(options);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public string Name
|
||||
@@ -166,26 +172,23 @@ namespace MediaBrowser.Server.Implementations.Photos
|
||||
|
||||
if (imageType == ImageType.Thumb)
|
||||
{
|
||||
await CreateThumbCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
return true;
|
||||
return await CreateThumbCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (imageType == ImageType.Primary)
|
||||
{
|
||||
if (item is UserView)
|
||||
{
|
||||
await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
return await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
}
|
||||
else if (item is PhotoAlbum || item is Playlist)
|
||||
{
|
||||
await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
return await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
await CreatePosterCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
|
||||
return await CreatePosterCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
throw new ArgumentException("Unexpected image type");
|
||||
|
||||
Reference in New Issue
Block a user