✨ Add sonarr-v4 compatibility (#689)

This commit is contained in:
Thomas Camlong authored and GitHub committed 2023-02-05 17:09:11 +01:00
1 parent cc9317b31c
commit 5296ce88d2
4 files changed
+25 -10

No files matched your search

+5 -1
View File
@@ -152,6 +152,10 @@ export function RadarrMediaDisplay(props: any) {
export function SonarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
const { config } = useConfigContext();
const calendar = config?.widgets.find((w) => w.id === 'calendar');
const useSonarrv4 = calendar?.properties.useSonarrv4 ?? false;
// Find a poster CoverType
const poster = media.series.images.find((image: any) => image.coverType === 'poster');
// Return a movie poster containting the title and the description
@@ -162,7 +166,7 @@ export function SonarrMediaDisplay(props: any) {
genres: media.series.genres ?? [],
overview: media.overview ?? media.series.overview ?? '',
title: media.series.title,
poster: poster ? poster.url : undefined,
poster: useSonarrv4 ? poster.remoteUrl : poster.url,
episodeNumber: media.episodeNumber,
seasonNumber: media.seasonNumber,
episodetitle: media.title,