aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-05-29 10:41:50 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-05-29 10:41:50 +0200
commit5feb70f489670808be682e1f2f80c4780651c57b (patch)
tree1acfb2c1e7f471c3d3b44293a288ad13f136bf68 /Emby.Server.Implementations
parent0beb07c40756aca5ab6a6ba4f8494bc5147e3c2b (diff)
Fix recently added episode links and posters
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index 321c7da1c4..f53328c7dd 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -1366,6 +1366,41 @@ namespace Emby.Server.Implementations.Dto
}
}
+ if (options.PreferEpisodeParentPoster)
+ {
+ var episodeSeason = episode.Season;
+ var seasonPrimaryTag = episodeSeason is not null
+ ? GetTagAndFillBlurhash(dto, episodeSeason, ImageType.Primary)
+ : null;
+
+ BaseItem? posterParent = null;
+ if (seasonPrimaryTag is not null)
+ {
+ dto.ParentPrimaryImageItemId = episodeSeason!.Id;
+ dto.ParentPrimaryImageTag = seasonPrimaryTag;
+ posterParent = episodeSeason;
+ }
+ else if (episodeSeries is not null && dto.SeriesPrimaryImageTag is not null)
+ {
+ dto.ParentPrimaryImageItemId = episodeSeries.Id;
+ dto.ParentPrimaryImageTag = dto.SeriesPrimaryImageTag;
+ posterParent = episodeSeries;
+ }
+
+ if (posterParent is not null)
+ {
+ if (dto.ImageTags is not null && dto.ImageTags.Remove(ImageType.Primary, out var ownPrimaryTag))
+ {
+ // Only drop the episode's own primary blurhash; keep the poster parent's.
+ dto.ImageBlurHashes?.GetValueOrDefault(ImageType.Primary)?.Remove(ownPrimaryTag);
+ }
+
+ dto.SeriesPrimaryImageTag = null;
+ dto.PrimaryImageAspectRatio = null;
+ AttachPrimaryImageAspectRatio(dto, posterParent);
+ }
+ }
+
if (options.ContainsField(ItemFields.SeriesStudio))
{
episodeSeries ??= episode.Series;