mirror of
https://github.com/Radarr/Radarr
synced 2025-01-02 21:34:35 +00:00
Hide ratings on movie table in absence of data
This commit is contained in:
parent
7532dfb03c
commit
d79db69644
2 changed files with 21 additions and 25 deletions
|
@ -360,15 +360,7 @@ function MovieIndexRow(props: MovieIndexRowProps) {
|
|||
if (name === 'tmdbRating') {
|
||||
return (
|
||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||
<TmdbRating ratings={ratings} />
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'rottenTomatoesRating') {
|
||||
return (
|
||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||
<RottenTomatoRating ratings={ratings} />
|
||||
{ratings.tmdb ? <TmdbRating ratings={ratings} /> : null}
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
@ -376,7 +368,17 @@ function MovieIndexRow(props: MovieIndexRowProps) {
|
|||
if (name === 'imdbRating') {
|
||||
return (
|
||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||
<ImdbRating ratings={ratings} />
|
||||
{ratings.imdb ? <ImdbRating ratings={ratings} /> : null}
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'rottenTomatoesRating') {
|
||||
return (
|
||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||
{ratings.rottenTomatoes ? (
|
||||
<RottenTomatoRating ratings={ratings} />
|
||||
) : null}
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue