mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
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
This commit is contained in:
parent
23929a3e70
commit
2c7d5c0f58
2 changed files with 19 additions and 9 deletions
|
|
@ -37,10 +37,23 @@ namespace Emby.Server.Implementations.Collections
|
|||
/// <inheritdoc />
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue