Browse Source

add episode thumbnail to xmltv template (#2550)

pull/2551/head
Jason Dove 2 months ago committed by GitHub
parent
commit
d4353f6d42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      CHANGELOG.md
  2. 7
      ErsatzTV.Application/Channels/Commands/RefreshChannelDataHandler.cs
  3. 2
      ErsatzTV/Controllers/ArtworkController.cs
  4. 6
      ErsatzTV/Resources/Templates/_episode.sbntxt

3
CHANGELOG.md

@ -23,6 +23,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -23,6 +23,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add playback speed to playback troubleshooting output
- Speed is relative to realtime (1.0x is realtime)
- Speeds < 0.9x will be colored red, between 0.9x and 1.1x colored yellow, and > 1.1x colored green
- Add episode thumbnail artwork URL to XMLTV template
- By default, poster will be added as image with type "poster" and thumbnail will be added as image with type "still"
- Poster will continue to be added as icon by default
### Fixed
- Fix NVIDIA startup errors on arm64

7
ErsatzTV.Application/Channels/Commands/RefreshChannelDataHandler.cs

@ -126,6 +126,10 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> @@ -126,6 +126,10 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
.ThenInclude(em => em.Guids)
.Include(p => p.Items)
.ThenInclude(i => i.MediaItem)
.ThenInclude(i => (i as Episode).EpisodeMetadata)
.ThenInclude(em => em.Artwork)
.Include(p => p.Items)
.ThenInclude(i => i.MediaItem)
.ThenInclude(i => (i as Episode).Season)
.ThenInclude(s => s.Show)
.ThenInclude(s => s.ShowMetadata)
@ -667,6 +671,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> @@ -667,6 +671,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
showMetadata.Guids ??= [];
string artworkPath = GetPrioritizedArtworkPath(showMetadata);
string thumbnailPath = GetPrioritizedArtworkPath(metadata);
var data = new
{
@ -687,6 +692,8 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> @@ -687,6 +692,8 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
ShowGenres = showMetadata.Genres.Map(g => g.Name).OrderBy(n => n),
EpisodeHasArtwork = !string.IsNullOrWhiteSpace(artworkPath),
EpisodeArtworkUrl = artworkPath,
EpisodeHasThumbnail = !string.IsNullOrWhiteSpace(thumbnailPath),
EpisodeThumbnailUrl = thumbnailPath,
SeasonNumber = templateEpisode.Season?.SeasonNumber ?? 0,
metadata.EpisodeNumber,
ShowHasContentRating = !string.IsNullOrWhiteSpace(showMetadata.ContentRating),

2
ErsatzTV/Controllers/ArtworkController.cs

@ -147,6 +147,8 @@ public class ArtworkController : ControllerBase @@ -147,6 +147,8 @@ public class ArtworkController : ControllerBase
GetPlexArtwork(plexMediaSourceId, $"/{path}", cancellationToken);
[HttpGet("/artwork/thumbnails/plex/{plexMediaSourceId}/{*path}")]
[HttpHead("/iptv/artwork/thumbnails/plex/{plexMediaSourceId}/{*path}")]
[HttpGet("/iptv/artwork/thumbnails/plex/{plexMediaSourceId}/{*path}")]
public Task<IActionResult> GetPlexThumbnail(
int plexMediaSourceId,
string path,

6
ErsatzTV/Resources/Templates/_episode.sbntxt

@ -18,6 +18,8 @@ Available values: @@ -18,6 +18,8 @@ Available values:
- show_genres
- episode_has_artwork
- episode_artwork_url
- episode_has_thumbnail
- episode_thumbnail_url
- season_number
- episode_number
- show_has_content_rating
@ -46,6 +48,10 @@ The resulting XML will be minified by ErsatzTV - so feel free to keep things nic @@ -46,6 +48,10 @@ The resulting XML will be minified by ErsatzTV - so feel free to keep things nic
{{ end }}
{{ if episode_has_artwork }}
<icon src="{{ episode_artwork_url }}" />
<image type="poster" size="3">{{ episode_artwork_url }}"</image>
{{ end }}
{{ if episode_has_thumbnail }}
<image type="still" orient="L" size="3">{{ episode_thumbnail_url }}</image>
{{ end }}
{{ end }}
<episode-num system="onscreen">S{{ season_number | math.format '00' }}E{{ episode_number | math.format '00' }}</episode-num>

Loading…
Cancel
Save