🐛 Fix a small bug with the display of images

This commit is contained in:
ajnart
2022-08-11 17:04:43 +02:00
parent cf89141f82
commit 4f94999b07
4 changed files with 22 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { ActionIcon, Badge, Button, Group, Image, Stack, Text, Title } from '@mantine/core';
import { Badge, Button, Group, Image, Stack, Text, Title } from '@mantine/core';
import { IconDownload, IconExternalLink, IconPlayerPlay } from '@tabler/icons';
import { useState } from 'react';
import { useColorTheme } from '../../tools/color';
@@ -63,9 +63,11 @@ export function ReadarrMediaDisplay(props: any) {
if (!readarr) {
return null;
}
const baseUrl = new URL(readarr.url).origin;
const baseUrl = readarr.openedUrl
? new URL(readarr.openedUrl).origin
: new URL(readarr.url).origin;
// Remove '/' from the end of the lidarr url
const fullLink = `${baseUrl}${poster.url}`;
const fullLink = poster ? `${baseUrl}${poster.url}` : undefined;
// Return a movie poster containting the title and the description
return (
<MediaDisplay
@@ -93,7 +95,7 @@ export function LidarrMediaDisplay(props: any) {
if (!lidarr) {
return null;
}
const baseUrl = new URL(lidarr.url).origin;
const baseUrl = lidarr.openedUrl ? new URL(lidarr.openedUrl).origin : new URL(lidarr.url).origin;
// Remove '/' from the end of the lidarr url
const fullLink = poster ? `${baseUrl}${poster.url}` : undefined;
// Return a movie poster containting the title and the description