diff --git a/frontend/src/Series/Details/EpisodeRow.css b/frontend/src/Series/Details/EpisodeRow.css index b27a69f1a..4a0940362 100644 --- a/frontend/src/Series/Details/EpisodeRow.css +++ b/frontend/src/Series/Details/EpisodeRow.css @@ -56,3 +56,9 @@ width: 120px; } + +.customFormatScore { + composes: cell from '~Components/Table/Cells/TableRowCell.css'; + + width: 55px; +} diff --git a/frontend/src/Series/Details/EpisodeRow.css.d.ts b/frontend/src/Series/Details/EpisodeRow.css.d.ts index 138000856..d4a5cfe93 100644 --- a/frontend/src/Series/Details/EpisodeRow.css.d.ts +++ b/frontend/src/Series/Details/EpisodeRow.css.d.ts @@ -3,6 +3,7 @@ interface CssExports { 'audio': string; 'audioLanguages': string; + 'customFormatScore': string; 'episodeNumber': string; 'episodeNumberAnime': string; 'languages': string; diff --git a/frontend/src/Series/Details/EpisodeRow.js b/frontend/src/Series/Details/EpisodeRow.js index eba223b16..4b9e827f6 100644 --- a/frontend/src/Series/Details/EpisodeRow.js +++ b/frontend/src/Series/Details/EpisodeRow.js @@ -4,6 +4,7 @@ import MonitorToggleButton from 'Components/MonitorToggleButton'; import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector'; import TableRowCell from 'Components/Table/Cells/TableRowCell'; import TableRow from 'Components/Table/TableRow'; +import Tooltip from 'Components/Tooltip/Tooltip'; import EpisodeFormats from 'Episode/EpisodeFormats'; import EpisodeNumber from 'Episode/EpisodeNumber'; import EpisodeSearchCellConnector from 'Episode/EpisodeSearchCellConnector'; @@ -12,7 +13,9 @@ import EpisodeTitleLink from 'Episode/EpisodeTitleLink'; import EpisodeFileLanguageConnector from 'EpisodeFile/EpisodeFileLanguageConnector'; import MediaInfoConnector from 'EpisodeFile/MediaInfoConnector'; import * as mediaInfoTypes from 'EpisodeFile/mediaInfoTypes'; +import { tooltipPositions } from 'Helpers/Props'; import formatBytes from 'Utilities/Number/formatBytes'; +import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore'; import formatRuntime from 'Utilities/Number/formatRuntime'; import styles from './EpisodeRow.css'; @@ -72,6 +75,7 @@ class EpisodeRow extends Component { episodeFileSize, releaseGroup, customFormats, + customFormatScore, alternateTitles, columns } = this.props; @@ -193,6 +197,24 @@ class EpisodeRow extends Component { ); } + if (name === 'customFormatScore') { + return ( + + } + position={tooltipPositions.BOTTOM} + /> + + ); + } + if (name === 'languages') { return ( Languages { get; set; } public QualityModel Quality { get; set; } public List CustomFormats { get; set; } + public int CustomFormatScore { get; set; } public MediaInfoResource MediaInfo { get; set; } public bool QualityCutoffNotMet { get; set; } @@ -67,6 +68,8 @@ namespace Sonarr.Api.V3.EpisodeFiles } model.Series = series; + var customFormats = formatCalculationService?.ParseCustomFormat(model, model.Series); + var customFormatScore = series?.QualityProfile?.Value?.CalculateCustomFormatScore(customFormats) ?? 0; return new EpisodeFileResource { @@ -84,7 +87,8 @@ namespace Sonarr.Api.V3.EpisodeFiles Quality = model.Quality, MediaInfo = model.MediaInfo.ToResource(model.SceneName), QualityCutoffNotMet = upgradableSpecification.QualityCutoffNotMet(series.QualityProfile.Value, model.Quality), - CustomFormats = formatCalculationService.ParseCustomFormat(model).ToResource(false) + CustomFormats = customFormats.ToResource(false), + CustomFormatScore = customFormatScore }; } }