mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-31 11:24:23 +02:00
New: Add Custom Format Score to file in Episode Details
This commit is contained in:
parent
29176c8367
commit
f50a263f4f
@ -17,6 +17,12 @@
|
|||||||
width: 175px;
|
width: 175px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.customFormatScore {
|
||||||
|
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||||
|
|
||||||
|
width: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Please do not change this file!
|
// Please do not change this file!
|
||||||
interface CssExports {
|
interface CssExports {
|
||||||
'actions': string;
|
'actions': string;
|
||||||
|
'customFormatScore': string;
|
||||||
'customFormats': string;
|
'customFormats': string;
|
||||||
'languages': string;
|
'languages': string;
|
||||||
'quality': string;
|
'quality': string;
|
||||||
|
@ -11,6 +11,7 @@ import EpisodeLanguages from 'Episode/EpisodeLanguages';
|
|||||||
import EpisodeQuality from 'Episode/EpisodeQuality';
|
import EpisodeQuality from 'Episode/EpisodeQuality';
|
||||||
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
||||||
import formatBytes from 'Utilities/Number/formatBytes';
|
import formatBytes from 'Utilities/Number/formatBytes';
|
||||||
|
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import MediaInfo from './MediaInfo';
|
import MediaInfo from './MediaInfo';
|
||||||
import styles from './EpisodeFileRow.css';
|
import styles from './EpisodeFileRow.css';
|
||||||
@ -55,6 +56,7 @@ class EpisodeFileRow extends Component {
|
|||||||
languages,
|
languages,
|
||||||
quality,
|
quality,
|
||||||
customFormats,
|
customFormats,
|
||||||
|
customFormatScore,
|
||||||
qualityCutoffNotMet,
|
qualityCutoffNotMet,
|
||||||
mediaInfo,
|
mediaInfo,
|
||||||
columns
|
columns
|
||||||
@ -127,6 +129,17 @@ class EpisodeFileRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (name === 'customFormatScore') {
|
||||||
|
return (
|
||||||
|
<TableRowCell
|
||||||
|
key={name}
|
||||||
|
className={styles.customFormatScore}
|
||||||
|
>
|
||||||
|
{formatCustomFormatScore(customFormatScore, customFormats.length)}
|
||||||
|
</TableRowCell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (name === 'actions') {
|
if (name === 'actions') {
|
||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
@ -183,6 +196,7 @@ EpisodeFileRow.propTypes = {
|
|||||||
quality: PropTypes.object.isRequired,
|
quality: PropTypes.object.isRequired,
|
||||||
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
||||||
customFormats: PropTypes.arrayOf(PropTypes.object),
|
customFormats: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
customFormatScore: PropTypes.number.isRequired,
|
||||||
mediaInfo: PropTypes.object,
|
mediaInfo: PropTypes.object,
|
||||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
onDeleteEpisodeFile: PropTypes.func.isRequired
|
onDeleteEpisodeFile: PropTypes.func.isRequired
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import Icon from 'Components/Icon';
|
||||||
import Label from 'Components/Label';
|
import Label from 'Components/Label';
|
||||||
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
||||||
import Table from 'Components/Table/Table';
|
import Table from 'Components/Table/Table';
|
||||||
import TableBody from 'Components/Table/TableBody';
|
import TableBody from 'Components/Table/TableBody';
|
||||||
import { kinds, sizes } from 'Helpers/Props';
|
import { icons, kinds, sizes } from 'Helpers/Props';
|
||||||
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
|
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import EpisodeAiringConnector from './EpisodeAiringConnector';
|
import EpisodeAiringConnector from './EpisodeAiringConnector';
|
||||||
@ -42,6 +43,15 @@ const columns = [
|
|||||||
isSortable: false,
|
isSortable: false,
|
||||||
isVisible: true
|
isVisible: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'customFormatScore',
|
||||||
|
label: React.createElement(Icon, {
|
||||||
|
name: icons.SCORE,
|
||||||
|
title: () => translate('CustomFormatScore')
|
||||||
|
}),
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'actions',
|
name: 'actions',
|
||||||
label: '',
|
label: '',
|
||||||
@ -94,6 +104,7 @@ class EpisodeSummary extends Component {
|
|||||||
languages,
|
languages,
|
||||||
quality,
|
quality,
|
||||||
customFormats,
|
customFormats,
|
||||||
|
customFormatScore,
|
||||||
qualityCutoffNotMet,
|
qualityCutoffNotMet,
|
||||||
onDeleteEpisodeFile
|
onDeleteEpisodeFile
|
||||||
} = this.props;
|
} = this.props;
|
||||||
@ -143,6 +154,7 @@ class EpisodeSummary extends Component {
|
|||||||
quality={quality}
|
quality={quality}
|
||||||
qualityCutoffNotMet={qualityCutoffNotMet}
|
qualityCutoffNotMet={qualityCutoffNotMet}
|
||||||
customFormats={customFormats}
|
customFormats={customFormats}
|
||||||
|
customFormatScore={customFormatScore}
|
||||||
mediaInfo={mediaInfo}
|
mediaInfo={mediaInfo}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
onDeleteEpisodeFile={onDeleteEpisodeFile}
|
onDeleteEpisodeFile={onDeleteEpisodeFile}
|
||||||
@ -179,6 +191,7 @@ EpisodeSummary.propTypes = {
|
|||||||
quality: PropTypes.object,
|
quality: PropTypes.object,
|
||||||
qualityCutoffNotMet: PropTypes.bool,
|
qualityCutoffNotMet: PropTypes.bool,
|
||||||
customFormats: PropTypes.arrayOf(PropTypes.object),
|
customFormats: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
customFormatScore: PropTypes.number.isRequired,
|
||||||
onDeleteEpisodeFile: PropTypes.func.isRequired
|
onDeleteEpisodeFile: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@ function createMapStateToProps() {
|
|||||||
languages,
|
languages,
|
||||||
quality,
|
quality,
|
||||||
qualityCutoffNotMet,
|
qualityCutoffNotMet,
|
||||||
customFormats
|
customFormats,
|
||||||
|
customFormatScore
|
||||||
} = episodeFile;
|
} = episodeFile;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -45,7 +46,8 @@ function createMapStateToProps() {
|
|||||||
languages,
|
languages,
|
||||||
quality,
|
quality,
|
||||||
qualityCutoffNotMet,
|
qualityCutoffNotMet,
|
||||||
customFormats
|
customFormats,
|
||||||
|
customFormatScore
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user