feat: add IMDb rating votes count in tooltip (#1696)
* feat: add IMDb rating votes count in tooltip * feat: add IMDb rating votes count in tooltip * feat: add IMDb rating votes count in tooltip
This commit is contained in:
@@ -145,6 +145,7 @@ export interface IMDBRating {
|
|||||||
title: string;
|
title: string;
|
||||||
url: string;
|
url: string;
|
||||||
criticsScore: number;
|
criticsScore: number;
|
||||||
|
criticsScoreCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -187,6 +188,7 @@ class IMDBRadarrProxy extends ExternalAPI {
|
|||||||
title: data[0].Title,
|
title: data[0].Title,
|
||||||
url: `https://www.imdb.com/title/${data[0].ImdbId}`,
|
url: `https://www.imdb.com/title/${data[0].ImdbId}`,
|
||||||
criticsScore: data[0].MovieRatings.Imdb.Value,
|
criticsScore: data[0].MovieRatings.Imdb.Value,
|
||||||
|
criticsScoreCount: data[0].MovieRatings.Imdb.Count,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ const messages = defineMessages('components.MovieDetails', {
|
|||||||
rtcriticsscore: 'Rotten Tomatoes Tomatometer',
|
rtcriticsscore: 'Rotten Tomatoes Tomatometer',
|
||||||
rtaudiencescore: 'Rotten Tomatoes Audience Score',
|
rtaudiencescore: 'Rotten Tomatoes Audience Score',
|
||||||
tmdbuserscore: 'TMDB User Score',
|
tmdbuserscore: 'TMDB User Score',
|
||||||
imdbuserscore: 'IMDB User Score',
|
imdbuserscore: 'IMDB User Score – votes: {formattedCount}',
|
||||||
watchlistSuccess: '<strong>{title}</strong> added to watchlist successfully!',
|
watchlistSuccess: '<strong>{title}</strong> added to watchlist successfully!',
|
||||||
watchlistDeleted:
|
watchlistDeleted:
|
||||||
'<strong>{title}</strong> Removed from watchlist successfully!',
|
'<strong>{title}</strong> Removed from watchlist successfully!',
|
||||||
@@ -812,7 +812,18 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{ratingData?.imdb?.criticsScore && (
|
{ratingData?.imdb?.criticsScore && (
|
||||||
<Tooltip content={intl.formatMessage(messages.imdbuserscore)}>
|
<Tooltip
|
||||||
|
content={intl.formatMessage(messages.imdbuserscore, {
|
||||||
|
formattedCount: intl.formatNumber(
|
||||||
|
ratingData.imdb.criticsScoreCount,
|
||||||
|
{
|
||||||
|
notation: 'compact',
|
||||||
|
compactDisplay: 'short',
|
||||||
|
maximumFractionDigits: 1,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
})}
|
||||||
|
>
|
||||||
<a
|
<a
|
||||||
href={ratingData.imdb.url}
|
href={ratingData.imdb.url}
|
||||||
className="media-rating"
|
className="media-rating"
|
||||||
|
|||||||
@@ -314,7 +314,7 @@
|
|||||||
"components.MovieDetails.cast": "Cast",
|
"components.MovieDetails.cast": "Cast",
|
||||||
"components.MovieDetails.digitalrelease": "Digital Release",
|
"components.MovieDetails.digitalrelease": "Digital Release",
|
||||||
"components.MovieDetails.downloadstatus": "Download Status",
|
"components.MovieDetails.downloadstatus": "Download Status",
|
||||||
"components.MovieDetails.imdbuserscore": "IMDB User Score",
|
"components.MovieDetails.imdbuserscore": "IMDB User Score – votes: {formattedCount}",
|
||||||
"components.MovieDetails.managemovie": "Manage Movie",
|
"components.MovieDetails.managemovie": "Manage Movie",
|
||||||
"components.MovieDetails.mark4kavailable": "Mark as Available in 4K",
|
"components.MovieDetails.mark4kavailable": "Mark as Available in 4K",
|
||||||
"components.MovieDetails.markavailable": "Mark as Available",
|
"components.MovieDetails.markavailable": "Mark as Available",
|
||||||
|
|||||||
Reference in New Issue
Block a user