diff --git a/frontend/src/App/State/MoviesAppState.ts b/frontend/src/App/State/MoviesAppState.ts index eeb172d03..c8db9ab36 100644 --- a/frontend/src/App/State/MoviesAppState.ts +++ b/frontend/src/App/State/MoviesAppState.ts @@ -22,6 +22,9 @@ export interface MovieIndexAppState { showQualityProfile: boolean; showReleaseDate: boolean; showCinemaRelease: boolean; + showTmdbRating: boolean; + showImdbRating: boolean; + showRottenTomatoesRating: boolean; showSearchAction: boolean; }; diff --git a/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx b/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx index 8866abecc..9803e5c91 100644 --- a/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx +++ b/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx @@ -100,6 +100,15 @@ function MovieIndexSortMenu(props: MovieIndexSortMenuProps) { {translate('DigitalRelease')} + + {translate('TmdbRating')} + + - {translate('TmdbRating')} + {translate('RottenTomatoesRating')} ) : null} + {showTmdbRating && !!ratings.tmdb ? ( +
+ +
+ ) : null} + + {showImdbRating && !!ratings.imdb ? ( +
+ +
+ ) : null} + + {showRottenTomatoesRating && !!ratings.rottenTomatoes ? ( +
+ +
+ ) : null} + + + + ); + } + + if (!showImdbRating && sortKey === 'imdbRating' && !!ratings.imdb) { return (
@@ -171,10 +186,14 @@ function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) { ); } - if (sortKey === 'tmdbRating' && !!ratings.tmdb) { + if ( + !showRottenTomatoesRating && + sortKey === 'rottenTomatoesRating' && + !!ratings.rottenTomatoes + ) { return (
- +
); } diff --git a/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx b/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx index b866daef6..87df52090 100644 --- a/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx +++ b/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx @@ -145,6 +145,9 @@ export default function MovieIndexPosters(props: MovieIndexPostersProps) { showQualityProfile, showCinemaRelease, showReleaseDate, + showTmdbRating, + showImdbRating, + showRottenTomatoesRating, } = posterOptions; const nextAiringHeight = 19; @@ -176,12 +179,22 @@ export default function MovieIndexPosters(props: MovieIndexPostersProps) { heights.push(19); } + if (showTmdbRating) { + heights.push(19); + } + + if (showImdbRating) { + heights.push(19); + } + + if (showRottenTomatoesRating) { + heights.push(19); + } + switch (sortKey) { case 'studio': case 'added': case 'year': - case 'imdbRating': - case 'tmdbRating': case 'path': case 'sizeOnDisk': case 'originalTitle': @@ -204,6 +217,21 @@ export default function MovieIndexPosters(props: MovieIndexPostersProps) { heights.push(19); } break; + case 'imdbRating': + if (!showImdbRating) { + heights.push(19); + } + break; + case 'tmdbRating': + if (!showTmdbRating) { + heights.push(19); + } + break; + case 'rottenTomatoesRating': + if (!showRottenTomatoesRating) { + heights.push(19); + } + break; default: // No need to add a height of 0 } diff --git a/frontend/src/Movie/Index/Posters/Options/MovieIndexPosterOptionsModalContent.tsx b/frontend/src/Movie/Index/Posters/Options/MovieIndexPosterOptionsModalContent.tsx index b9d0f48b1..9617ebd3c 100644 --- a/frontend/src/Movie/Index/Posters/Options/MovieIndexPosterOptionsModalContent.tsx +++ b/frontend/src/Movie/Index/Posters/Options/MovieIndexPosterOptionsModalContent.tsx @@ -54,6 +54,9 @@ function MovieIndexPosterOptionsModalContent( showQualityProfile, showCinemaRelease, showReleaseDate, + showTmdbRating, + showImdbRating, + showRottenTomatoesRating, showSearchAction, } = posterOptions; @@ -156,6 +159,42 @@ function MovieIndexPosterOptionsModalContent( /> + + {translate('ShowTmdbRating')} + + + + + + {translate('ShowImdbRating')} + + + + + + {translate('ShowRottenTomatoesRating')} + + + + {translate('ShowSearch')} diff --git a/frontend/src/Store/Actions/movieIndexActions.js b/frontend/src/Store/Actions/movieIndexActions.js index 60d5f0fe9..b4b1c5b0a 100644 --- a/frontend/src/Store/Actions/movieIndexActions.js +++ b/frontend/src/Store/Actions/movieIndexActions.js @@ -35,6 +35,9 @@ export const defaultState = { showQualityProfile: true, showCinemaRelease: false, showReleaseDate: false, + showTmdbRating: false, + showImdbRating: false, + showRottenTomatoesRating: false, showSearchAction: false }, @@ -253,7 +256,7 @@ export const defaultState = { rottenTomatoesRating: function(item) { const { ratings = {} } = item; - return ratings.rottenTomatoes ? ratings.rottenTomatoes.value : 0; + return ratings.rottenTomatoes ? ratings.rottenTomatoes.value : -1; } }, diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 6f3bb3f40..4c4097e7b 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -1021,6 +1021,8 @@ "ShowCutoffUnmetIconHelpText": "Show icon for files when the cutoff hasn't been met", "ShowDateAdded": "Show Date Added", "ShowGenres": "Show Genres", + "ShowImdbRating": "Show IMDb Rating", + "ShowImdbRatingHelpText": "Show IMDb rating under poster", "ShowMonitored": "Show Monitored", "ShowMonitoredHelpText": "Show monitored status under poster", "ShowMovieInformation": "Show Movie Information", @@ -1033,12 +1035,16 @@ "ShowRatings": "Show Ratings", "ShowReleaseDate": "Show Release Date", "ShowReleaseDateHelpText": "Show release date under poster", + "ShowRottenTomatoesRating": "Show Tomato Rating", + "ShowRottenTomatoesRatingHelpText": "Show Tomato rating under poster", "ShowSearch": "Show Search", "ShowSearchHelpText": "Show search button on hover", "ShowSizeOnDisk": "Show Size on Disk", "ShowStudio": "Show Studio", "ShowTitle": "Show Title", "ShowTitleHelpText": "Show movie title under poster", + "ShowTmdbRating": "Show TMDb Rating", + "ShowTmdbRatingHelpText": "Show TMDb rating under poster", "ShowUnknownMovieItems": "Show Unknown Movie Items", "ShowYear": "Show Year", "ShownClickToHide": "Shown, click to hide",