From 2c7d5c0f58bceadc9ab5210fa4c0ea504264e0fa Mon Sep 17 00:00:00 2001 From: Eirik Lillebo Date: Sat, 1 Nov 2025 01:36:32 +0100 Subject: [PATCH] Fix: Allow collection thumbnails to be generated from content - Modified CollectionImageProvider to allow dynamic images for unlocked collections when no local Primary image exists - Updated BaseDynamicImageProvider to only skip generation when a local image already exists in metadata folder (allows generation even with remote images) - Fixes issue where auto-created collections weren't getting thumbnails generated from their content items --- .../Collections/CollectionImageProvider.cs | 19 ++++++++++++++++--- .../Images/BaseDynamicImageProvider.cs | 9 +++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs index c31bb4fb97..abc3b5adcf 100644 --- a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs +++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs @@ -37,10 +37,23 @@ namespace Emby.Server.Implementations.Collections /// protected override bool Supports(BaseItem item) { - // Right now this is the only way to prevent this image from getting created ahead of internet image providers - if (!item.IsLocked) + // If the collection is locked, always allow dynamic images + if (item.IsLocked) { - return false; + return base.Supports(item); + } + + // If not locked, only allow dynamic images if there's no local Primary image + // This allows fallback generation when remote providers don't provide images + // while still preventing it from running ahead of internet image providers + var image = item.GetImageInfo(ImageType.Primary, 0); + if (image is not null) + { + // If there's a local Primary image in the metadata folder, don't generate + if (image.IsLocalFile && FileSystem.ContainsSubPath(item.GetInternalMetadataPath(), image.Path)) + { + return false; + } } return base.Supports(item); diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs index 4874eca8e6..a1856127df 100644 --- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs +++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs @@ -82,12 +82,9 @@ namespace Emby.Server.Implementations.Images if (image is not null) { - if (!image.IsLocalFile) - { - return Task.FromResult(ItemUpdateType.None); - } - - if (!FileSystem.ContainsSubPath(item.GetInternalMetadataPath(), image.Path)) + // Only skip generation if there's already a local image in the metadata folder + // This allows dynamic images to be generated even when remote images exist + if (image.IsLocalFile && FileSystem.ContainsSubPath(item.GetInternalMetadataPath(), image.Path)) { return Task.FromResult(ItemUpdateType.None); }