1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-19 17:32:38 +01:00

Fixed: Showing multi-languages for movies parsed without languages

This commit is contained in:
Bogdan 2024-08-14 19:26:52 +03:00
parent 37c09ba1f8
commit 4ae382cea7
10 changed files with 33 additions and 46 deletions

View File

@ -7,7 +7,7 @@ import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
import TableRow from 'Components/Table/TableRow';
import { icons, kinds } from 'Helpers/Props';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import MovieTitleLink from 'Movie/MovieTitleLink';
import translate from 'Utilities/String/translate';
@ -104,7 +104,7 @@ class BlocklistRow extends Component {
if (name === 'languages') {
return (
<TableRowCell key={name}>
<MovieLanguage
<MovieLanguages
languages={languages}
/>
</TableRowCell>

View File

@ -7,7 +7,7 @@ import TableRow from 'Components/Table/TableRow';
import Tooltip from 'Components/Tooltip/Tooltip';
import { icons, tooltipPositions } from 'Helpers/Props';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import MovieTitleLink from 'Movie/MovieTitleLink';
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
@ -113,7 +113,7 @@ class HistoryRow extends Component {
if (name === 'languages') {
return (
<TableRowCell key={name}>
<MovieLanguage
<MovieLanguages
languages={languages}
/>
</TableRowCell>

View File

@ -12,7 +12,7 @@ import Tooltip from 'Components/Tooltip/Tooltip';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import InteractiveImportModal from 'InteractiveImport/InteractiveImportModal';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import MovieTitleLink from 'Movie/MovieTitleLink';
import formatBytes from 'Utilities/Number/formatBytes';
@ -175,7 +175,7 @@ class QueueRow extends Component {
if (name === 'languages') {
return (
<TableRowCell key={name}>
<MovieLanguage
<MovieLanguages
languages={languages}
/>
</TableRowCell>

View File

@ -17,7 +17,7 @@ import Language from 'Language/Language';
import IndexerFlags from 'Movie/IndexerFlags';
import Movie from 'Movie/Movie';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import { QualityModel } from 'Quality/Quality';
import {
@ -322,7 +322,7 @@ function InteractiveImportRow(props: InteractiveImportRowProps) {
{showLanguagePlaceholder && <InteractiveImportRowCellPlaceholder />}
{!showLanguagePlaceholder && !!languages && (
<MovieLanguage className={styles.label} languages={languages} />
<MovieLanguages className={styles.label} languages={languages} />
)}
</TableRowCellButton>

View File

@ -12,7 +12,7 @@ import type DownloadProtocol from 'DownloadClient/DownloadProtocol';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import Language from 'Language/Language';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import { QualityModel } from 'Quality/Quality';
import CustomFormat from 'typings/CustomFormat';
@ -262,7 +262,7 @@ function InteractiveSearchRow(props: InteractiveSearchRowProps) {
</TableRowCell>
<TableRowCell className={styles.languages}>
<MovieLanguage languages={languages} />
<MovieLanguages languages={languages} />
</TableRowCell>
<TableRowCell className={styles.quality}>

View File

@ -15,7 +15,7 @@ import SelectMovieModal from 'InteractiveImport/Movie/SelectMovieModal';
import SelectQualityModal from 'InteractiveImport/Quality/SelectQualityModal';
import Language from 'Language/Language';
import Movie from 'Movie/Movie';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import { QualityModel } from 'Quality/Quality';
import { grabRelease } from 'Store/Actions/releaseActions';
@ -215,7 +215,7 @@ function OverrideMatchModalContent(props: OverrideMatchModalContentProps) {
data={
<OverrideMatchData
value={
<MovieLanguage
<MovieLanguages
className={styles.label}
languages={languages}
/>

View File

@ -8,7 +8,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import { icons, kinds } from 'Helpers/Props';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import formatDateTime from 'Utilities/Date/formatDateTime';
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
@ -89,7 +89,7 @@ class MovieHistoryRow extends Component {
</TableRowCell>
<TableRowCell>
<MovieLanguage
<MovieLanguages
languages={languages}
/>
</TableRowCell>

View File

@ -1,18 +1,21 @@
import PropTypes from 'prop-types';
import React from 'react';
import Label from 'Components/Label';
import Popover from 'Components/Tooltip/Popover';
import { kinds, tooltipPositions } from 'Helpers/Props';
import Language from 'Language/Language';
import translate from 'Utilities/String/translate';
function MovieLanguage(props) {
const {
className,
languages,
isCutoffNotMet
} = props;
interface MovieLanguagesProps {
className?: string;
languages: Language[];
isCutoffNotMet?: boolean;
}
if (!languages) {
function MovieLanguages(props: MovieLanguagesProps) {
const { className, languages, isCutoffNotMet = true } = props;
// TODO: Typescript - Remove once everything is converted
if (!languages || languages.length === 0) {
return null;
}
@ -41,15 +44,9 @@ function MovieLanguage(props) {
title={translate('Languages')}
body={
<ul>
{
languages.map((language) => {
return (
<li key={language.id}>
{language.name}
</li>
);
})
}
{languages.map((language) => (
<li key={language.id}>{language.name}</li>
))}
</ul>
}
position={tooltipPositions.LEFT}
@ -57,14 +54,4 @@ function MovieLanguage(props) {
);
}
MovieLanguage.propTypes = {
className: PropTypes.string,
languages: PropTypes.arrayOf(PropTypes.object),
isCutoffNotMet: PropTypes.bool
};
MovieLanguage.defaultProps = {
isCutoffNotMet: true
};
export default MovieLanguage;
export default MovieLanguages;

View File

@ -11,7 +11,7 @@ import Tooltip from 'Components/Tooltip/Tooltip';
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
import IndexerFlags from 'Movie/IndexerFlags';
import MovieFormats from 'Movie/MovieFormats';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import MovieQuality from 'Movie/MovieQuality';
import FileEditModal from 'MovieFile/Edit/FileEditModal';
import MediaInfoConnector from 'MovieFile/MediaInfoConnector';
@ -185,7 +185,7 @@ class MovieFileEditorRow extends Component {
{
!showLanguagePlaceholder && !!languages &&
<MovieLanguage
<MovieLanguages
className={styles.label}
languages={languages}
/>

View File

@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import MovieLanguage from 'Movie/MovieLanguage';
import MovieLanguages from 'Movie/MovieLanguages';
import createMovieFileSelector from 'Store/Selectors/createMovieFileSelector';
function createMapStateToProps() {
@ -14,4 +14,4 @@ function createMapStateToProps() {
);
}
export default connect(createMapStateToProps)(MovieLanguage);
export default connect(createMapStateToProps)(MovieLanguages);