New: Add Original Language as Filter Option in Discover View

Closes #7807
pull/8429/head
Qstick 2 years ago
parent cba4850769
commit 4c2bf285fc

@ -26,6 +26,12 @@
flex: 0 0 180px; flex: 0 0 180px;
} }
.originalLanguage {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
flex: 1 0 125px;
}
.ratings, .ratings,
.runtime { .runtime {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css'; composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';

@ -9,6 +9,7 @@ interface CssExports {
'inCinemas': string; 'inCinemas': string;
'isRecommendation': string; 'isRecommendation': string;
'lists': string; 'lists': string;
'originalLanguage': string;
'physicalRelease': string; 'physicalRelease': string;
'ratings': string; 'ratings': string;
'runtime': string; 'runtime': string;

@ -51,6 +51,12 @@
flex: 0 0 115px; flex: 0 0 115px;
} }
.originalLanguage {
composes: cell;
flex: 1 0 125px;
}
.ratings, .ratings,
.runtime { .runtime {
composes: cell; composes: cell;

@ -14,6 +14,7 @@ interface CssExports {
'inCinemas': string; 'inCinemas': string;
'isRecommendation': string; 'isRecommendation': string;
'lists': string; 'lists': string;
'originalLanguage': string;
'physicalRelease': string; 'physicalRelease': string;
'ratings': string; 'ratings': string;
'runtime': string; 'runtime': string;

@ -61,6 +61,7 @@ class DiscoverMovieRow extends Component {
imdbId, imdbId,
youTubeTrailerId, youTubeTrailerId,
title, title,
originalLanguage,
studio, studio,
inCinemas, inCinemas,
physicalRelease, physicalRelease,
@ -169,6 +170,14 @@ class DiscoverMovieRow extends Component {
); );
} }
if (name === 'originalLanguage') {
return (
<VirtualTableRowCell key={name} className={styles[name]}>
{originalLanguage.name}
</VirtualTableRowCell>
);
}
if (name === 'studio') { if (name === 'studio') {
return ( return (
<VirtualTableRowCell <VirtualTableRowCell
@ -363,6 +372,7 @@ DiscoverMovieRow.propTypes = {
youTubeTrailerId: PropTypes.string, youTubeTrailerId: PropTypes.string,
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
originalLanguage: PropTypes.object.isRequired,
year: PropTypes.number.isRequired, year: PropTypes.number.isRequired,
overview: PropTypes.string.isRequired, overview: PropTypes.string.isRequired,
folder: PropTypes.string.isRequired, folder: PropTypes.string.isRequired,

@ -94,6 +94,12 @@ export const defaultState = {
isVisible: true, isVisible: true,
isModifiable: false isModifiable: false
}, },
{
name: 'originalLanguage',
label: translate('OriginalLanguage'),
isSortable: true,
isVisible: false
},
{ {
name: 'collection', name: 'collection',
label: translate('Collection'), label: translate('Collection'),
@ -191,6 +197,12 @@ export const defaultState = {
return collection.title; return collection.title;
}, },
originalLanguage: function(item) {
const { originalLanguage ={} } = item;
return originalLanguage.name;
},
studio: function(item) { studio: function(item) {
const studio = item.studio; const studio = item.studio;
@ -275,6 +287,25 @@ export const defaultState = {
return collectionList.sort(sortByName); return collectionList.sort(sortByName);
} }
}, },
{
name: 'originalLanguage',
label: translate('OriginalLanguage'),
type: filterBuilderTypes.EXACT,
optionsSelector: function(items) {
const collectionList = items.reduce((acc, movie) => {
if (movie.originalLanguage) {
acc.push({
id: movie.originalLanguage.name,
name: movie.originalLanguage.name
});
}
return acc;
}, []);
return collectionList.sort(sortByName);
}
},
{ {
name: 'inCinemas', name: 'inCinemas',
label: 'In Cinemas', label: 'In Cinemas',

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.ImportLists.ImportListMovies; using NzbDrone.Core.ImportLists.ImportListMovies;
using NzbDrone.Core.Languages;
using NzbDrone.Core.MediaCover; using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
using NzbDrone.Core.Movies.Collections; using NzbDrone.Core.Movies.Collections;
@ -17,6 +18,7 @@ namespace Radarr.Api.V3.ImportLists
public string Title { get; set; } public string Title { get; set; }
public string SortTitle { get; set; } public string SortTitle { get; set; }
public Language OriginalLanguage { get; set; }
public MovieStatusType Status { get; set; } public MovieStatusType Status { get; set; }
public string Overview { get; set; } public string Overview { get; set; }
public DateTime? InCinemas { get; set; } public DateTime? InCinemas { get; set; }
@ -58,6 +60,7 @@ namespace Radarr.Api.V3.ImportLists
TmdbId = model.TmdbId, TmdbId = model.TmdbId,
Title = model.Title, Title = model.Title,
SortTitle = model.MovieMetadata.Value.SortTitle, SortTitle = model.MovieMetadata.Value.SortTitle,
OriginalLanguage = model.MovieMetadata.Value.OriginalLanguage,
InCinemas = model.MovieMetadata.Value.InCinemas, InCinemas = model.MovieMetadata.Value.InCinemas,
PhysicalRelease = model.MovieMetadata.Value.PhysicalRelease, PhysicalRelease = model.MovieMetadata.Value.PhysicalRelease,
DigitalRelease = model.MovieMetadata.Value.DigitalRelease, DigitalRelease = model.MovieMetadata.Value.DigitalRelease,
@ -93,6 +96,7 @@ namespace Radarr.Api.V3.ImportLists
TmdbId = model.TmdbId, TmdbId = model.TmdbId,
Title = model.Title, Title = model.Title,
SortTitle = model.MovieMetadata.Value.SortTitle, SortTitle = model.MovieMetadata.Value.SortTitle,
OriginalLanguage = model.MovieMetadata.Value.OriginalLanguage,
InCinemas = model.MovieMetadata.Value.InCinemas, InCinemas = model.MovieMetadata.Value.InCinemas,
PhysicalRelease = model.MovieMetadata.Value.PhysicalRelease, PhysicalRelease = model.MovieMetadata.Value.PhysicalRelease,
DigitalRelease = model.MovieMetadata.Value.DigitalRelease, DigitalRelease = model.MovieMetadata.Value.DigitalRelease,

Loading…
Cancel
Save