New: Add MDBList link to series details

Closes #7162
series-links-on-ios
Mark McDowall 6 months ago committed by GitHub
parent ee99c3895d
commit 55aaaa5c40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

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

Loading…
Cancel
Save