diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-06-01 21:59:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-01 21:59:06 +0200 |
| commit | 53eda14dccddbcbd8806150489ff8f4495814631 (patch) | |
| tree | f2db2d10496c90a554a41a5366d191a75b7629d4 /Emby.Server.Implementations | |
| parent | 0d30a595642c647828c5e62bd64c067d5c33c02f (diff) | |
| parent | 5feb70f489670808be682e1f2f80c4780651c57b (diff) | |
Fix recently added episode links and posters
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 35 |
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; |
