1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00

New: Add MDBList link to series details

Closes #7162
This commit is contained in:
Mark McDowall 2024-09-03 20:19:36 -07:00 committed by GitHub
parent ee99c3895d
commit 55aaaa5c40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 46 additions and 41 deletions

View File

@ -1,23 +1,23 @@
import PropTypes from 'prop-types';
import React from 'react';
import Label from 'Components/Label';
import Link from 'Components/Link/Link';
import { kinds, sizes } from 'Helpers/Props';
import Series from 'Series/Series';
import styles from './SeriesDetailsLinks.css';
function SeriesDetailsLinks(props) {
const {
tvdbId,
tvMazeId,
imdbId,
tmdbId
} = props;
type SeriesDetailsLinksProps = Pick<
Series,
'tvdbId' | 'tvMazeId' | 'imdbId' | 'tmdbId'
>;
function SeriesDetailsLinks(props: SeriesDetailsLinksProps) {
const { tvdbId, tvMazeId, imdbId, tmdbId } = props;
return (
<div className={styles.links}>
<Link
className={styles.link}
to={`http://www.thetvdb.com/?tab=series&id=${tvdbId}`}
to={`https://www.thetvdb.com/?tab=series&id=${tvdbId}`}
>
<Label
className={styles.linkLabel}
@ -30,7 +30,7 @@ function SeriesDetailsLinks(props) {
<Link
className={styles.link}
to={`http://trakt.tv/search/tvdb/${tvdbId}?id_type=show`}
to={`https://trakt.tv/search/tvdb/${tvdbId}?id_type=show`}
>
<Label
className={styles.linkLabel}
@ -41,27 +41,26 @@ function SeriesDetailsLinks(props) {
</Label>
</Link>
{
!!tvMazeId &&
<Link
className={styles.link}
to={`http://www.tvmaze.com/shows/${tvMazeId}/_`}
{tvMazeId ? (
<Link
className={styles.link}
to={`https://www.tvmaze.com/shows/${tvMazeId}/_`}
>
<Label
className={styles.linkLabel}
kind={kinds.INFO}
size={sizes.LARGE}
>
<Label
className={styles.linkLabel}
kind={kinds.INFO}
size={sizes.LARGE}
>
TV Maze
</Label>
</Link>
}
TV Maze
</Label>
</Link>
) : null}
{
!!imdbId &&
{imdbId ? (
<>
<Link
className={styles.link}
to={`http://imdb.com/title/${imdbId}/`}
to={`https://imdb.com/title/${imdbId}/`}
>
<Label
className={styles.linkLabel}
@ -71,32 +70,38 @@ function SeriesDetailsLinks(props) {
IMDB
</Label>
</Link>
}
{
!!tmdbId &&
<Link
className={styles.link}
to={`https://www.themoviedb.org/tv/${tmdbId}`}
to={`http://mdblist.com/show/${imdbId}`}
>
<Label
className={styles.linkLabel}
kind={kinds.INFO}
size={sizes.LARGE}
>
TMDB
MDBList
</Label>
</Link>
}
</>
) : null}
{tmdbId ? (
<Link
className={styles.link}
to={`https://www.themoviedb.org/tv/${tmdbId}`}
>
<Label
className={styles.linkLabel}
kind={kinds.INFO}
size={sizes.LARGE}
>
TMDB
</Label>
</Link>
) : null}
</div>
);
}
SeriesDetailsLinks.propTypes = {
tvdbId: PropTypes.number.isRequired,
tvMazeId: PropTypes.number,
imdbId: PropTypes.string,
tmdbId: PropTypes.number
};
export default SeriesDetailsLinks;

View File

@ -73,7 +73,7 @@ interface Series extends ModelBase {
firstAired: string;
genres: string[];
images: Image[];
imdbId: string;
imdbId?: string;
monitored: boolean;
monitorNewItems: MonitorNewItems;
network: string;