Skip to content

Commit

Permalink
fix: conditional media server name for 4k url to add emby to tvdetails
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallenbagel committed May 26, 2022
1 parent e75b71b commit ddd773c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/TvDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
})
) {
mediaLinks.push({
text: getAvalaibleMediaServerName(),
text: getAvalaible4kMediaServerName(),
url: data.mediaInfo?.mediaUrl4k,
svg: <PlayIcon />,
});
Expand Down Expand Up @@ -234,6 +234,18 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
return intl.formatMessage(messages.play, { mediaServerName: 'Jellyfin' });
}

function getAvalaible4kMediaServerName() {
if (process.env.JELLYFIN_TYPE === 'emby') {
return intl.formatMessage(messages.play4k, { mediaServerName: 'Emby' });
}

if (settings.currentSettings.mediaServerType === MediaServerType.PLEX) {
return intl.formatMessage(messages.play4k, { mediaServerName: 'Plex' });
}

return intl.formatMessage(messages.play4k, { mediaServerName: 'Jellyfin' });
}

return (
<div
className="media-page"
Expand Down

0 comments on commit ddd773c

Please sign in to comment.