Skip to content

Commit

Permalink
🐛 Overseerr link in search not working fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SeDemal committed Nov 13, 2023
1 parent a3ca74a commit d2441ba
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/layout/header/Search/MovieModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Button,
Card,
Center,
Divider,
Grid,
Group,
Loader,
Expand Down Expand Up @@ -134,8 +133,11 @@ const MovieDisplay = ({ movie, type }: MovieDisplayProps) => {

const service = config.apps.find((service) => service.integration.type === type);
const mediaUrl = movie.mediaInfo?.plexUrl ?? movie.mediaInfo?.mediaUrl;
const serviceUrl = service?.behaviour.externalUrl ? service.behaviour.externalUrl : service?.url;
const externalUrl = movie.mediaInfo?.serviceUrl;
const serviceUrl = service?.behaviour.externalUrl ?? service?.url;
const externalUrl = new URL(
`${movie.mediaType}/${movie.id}`,
serviceUrl ?? 'https://www.themoviedb.org'
);

return (
<Card withBorder>
Expand Down Expand Up @@ -192,16 +194,16 @@ const MovieDisplay = ({ movie, type }: MovieDisplayProps) => {
{t('buttons.play')}
</Button>
)}
{serviceUrl && (
{externalUrl && (
<Button
component="a"
target="_blank"
href={externalUrl}
href={externalUrl.href}
variant="outline"
size="sm"
rightIcon={<IconExternalLink size={15} />}
>
{type === 'jellyseerr' ? 'Jellyfin' : 'Overseerr'}
{serviceUrl ? (type === 'jellyseerr' ? 'Jellyfin' : 'Overseerr') : 'TMDB'}
</Button>
)}
</Group>
Expand Down

0 comments on commit d2441ba

Please sign in to comment.