diff --git a/frontend/src/Movie/Index/Table/MovieIndexRow.tsx b/frontend/src/Movie/Index/Table/MovieIndexRow.tsx index 91137f4f4..99faf3a89 100644 --- a/frontend/src/Movie/Index/Table/MovieIndexRow.tsx +++ b/frontend/src/Movie/Index/Table/MovieIndexRow.tsx @@ -360,15 +360,7 @@ function MovieIndexRow(props: MovieIndexRowProps) { if (name === 'tmdbRating') { return ( - - - ); - } - - if (name === 'rottenTomatoesRating') { - return ( - - + {ratings.tmdb ? : null} ); } @@ -376,7 +368,17 @@ function MovieIndexRow(props: MovieIndexRowProps) { if (name === 'imdbRating') { return ( - + {ratings.imdb ? : null} + + ); + } + + if (name === 'rottenTomatoesRating') { + return ( + + {ratings.rottenTomatoes ? ( + + ) : null} ); } diff --git a/frontend/src/Store/Actions/movieIndexActions.js b/frontend/src/Store/Actions/movieIndexActions.js index 7e6efd3d6..c3d531e30 100644 --- a/frontend/src/Store/Actions/movieIndexActions.js +++ b/frontend/src/Store/Actions/movieIndexActions.js @@ -191,14 +191,14 @@ export const defaultState = { isVisible: false }, { - name: 'rottenTomatoesRating', - label: () => translate('RottenTomatoesRating'), + name: 'imdbRating', + label: () => translate('ImdbRating'), isSortable: true, isVisible: false }, { - name: 'imdbRating', - label: () => translate('ImdbRating'), + name: 'rottenTomatoesRating', + label: () => translate('RottenTomatoesRating'), isSortable: true, isVisible: false }, @@ -266,21 +266,15 @@ export const defaultState = { undefined; }, - imdbRating: function(item) { - const { ratings = {} } = item; - - return ratings.imdb ? ratings.imdb.value : 0; - }, - - tmdbRating: function(item) { - const { ratings = {} } = item; - + tmdbRating: function({ ratings = {} }) { return ratings.tmdb ? ratings.tmdb.value : 0; }, - rottenTomatoesRating: function(item) { - const { ratings = {} } = item; + imdbRating: function({ ratings = {} }) { + return ratings.imdb ? ratings.imdb.value : 0; + }, + rottenTomatoesRating: function({ ratings = {} }) { return ratings.rottenTomatoes ? ratings.rottenTomatoes.value : -1; } },