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;
}
.originalLanguage {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
flex: 1 0 125px;
}
.ratings,
.runtime {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';

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

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

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

@ -61,6 +61,7 @@ class DiscoverMovieRow extends Component {
imdbId,
youTubeTrailerId,
title,
originalLanguage,
studio,
inCinemas,
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') {
return (
<VirtualTableRowCell
@ -363,6 +372,7 @@ DiscoverMovieRow.propTypes = {
youTubeTrailerId: PropTypes.string,
status: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
originalLanguage: PropTypes.object.isRequired,
year: PropTypes.number.isRequired,
overview: PropTypes.string.isRequired,
folder: PropTypes.string.isRequired,

@ -94,6 +94,12 @@ export const defaultState = {
isVisible: true,
isModifiable: false
},
{
name: 'originalLanguage',
label: translate('OriginalLanguage'),
isSortable: true,
isVisible: false
},
{
name: 'collection',
label: translate('Collection'),
@ -191,6 +197,12 @@ export const defaultState = {
return collection.title;
},
originalLanguage: function(item) {
const { originalLanguage ={} } = item;
return originalLanguage.name;
},
studio: function(item) {
const studio = item.studio;
@ -275,6 +287,25 @@ export const defaultState = {
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',
label: 'In Cinemas',

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

Loading…
Cancel
Save