From 4a9c77c32713ed0a52597f9abb7313062ef1872f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 2 Dec 2016 15:45:11 -0500 Subject: [PATCH] update backdrops --- .../Images/BaseDynamicImageProvider.cs | 5 +++++ .../UserViews/DynamicImageProvider.cs | 16 +++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs index 5a8be5a495..7a36691dff 100644 --- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs +++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs @@ -149,6 +149,11 @@ namespace Emby.Server.Implementations.Images var mimeType = MimeTypes.GetMimeType(outputPath); + if (string.Equals(mimeType, "application/octet-stream", StringComparison.OrdinalIgnoreCase)) + { + mimeType = "image/png"; + } + await ProviderManager.SaveImage(item, outputPath, mimeType, imageType, null, false, cancellationToken).ConfigureAwait(false); return ItemUpdateType.ImageUpdate; diff --git a/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs b/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs index 245fe8ebe5..bef964c6fa 100644 --- a/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs +++ b/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs @@ -159,20 +159,14 @@ namespace Emby.Server.Implementations.UserViews protected override async Task CreateImage(IHasImages item, List itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex) { - var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ".png"); - - var view = (UserView)item; - if (imageType == ImageType.Primary && IsUsingCollectionStrip(view)) + if (itemsWithImages.Count == 0) { - if (itemsWithImages.Count == 0) - { - return null; - } - - return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540).ConfigureAwait(false); + return null; } - return await base.CreateImage(item, itemsWithImages, outputPath, imageType, imageIndex).ConfigureAwait(false); + var outputPath = Path.ChangeExtension(outputPathWithoutExtension, ".png"); + + return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540).ConfigureAwait(false); } } }