diff --git a/frontend/src/Activity/History/HistoryRow.js b/frontend/src/Activity/History/HistoryRow.js index 4fd2a3b30..9b5a15c23 100644 --- a/frontend/src/Activity/History/HistoryRow.js +++ b/frontend/src/Activity/History/HistoryRow.js @@ -62,6 +62,7 @@ class HistoryRow extends Component { languages, quality, customFormats, + customFormatScore, qualityCutoffNotMet, eventType, sourceTitle, @@ -209,7 +210,7 @@ class HistoryRow extends Component { key={name} className={styles.customFormatScore} > - {formatPreferredWordScore(data.customFormatScore)} + {formatPreferredWordScore(customFormatScore)} ); } @@ -277,6 +278,7 @@ HistoryRow.propTypes = { languages: PropTypes.arrayOf(PropTypes.object).isRequired, quality: PropTypes.object.isRequired, customFormats: PropTypes.arrayOf(PropTypes.object), + customFormatScore: PropTypes.number.isRequired, qualityCutoffNotMet: PropTypes.bool.isRequired, eventType: PropTypes.string.isRequired, sourceTitle: PropTypes.string.isRequired, diff --git a/frontend/src/Episode/History/EpisodeHistoryRow.js b/frontend/src/Episode/History/EpisodeHistoryRow.js index 373a1bd67..316f480a5 100644 --- a/frontend/src/Episode/History/EpisodeHistoryRow.js +++ b/frontend/src/Episode/History/EpisodeHistoryRow.js @@ -69,6 +69,7 @@ class EpisodeHistoryRow extends Component { quality, qualityCutoffNotMet, customFormats, + customFormatScore, date, data } = this.props; @@ -125,7 +126,7 @@ class EpisodeHistoryRow extends Component { } position={tooltipPositions.BOTTOM} @@ -165,6 +166,7 @@ EpisodeHistoryRow.propTypes = { quality: PropTypes.object.isRequired, qualityCutoffNotMet: PropTypes.bool.isRequired, customFormats: PropTypes.arrayOf(PropTypes.object), + customFormatScore: PropTypes.number.isRequired, date: PropTypes.string.isRequired, data: PropTypes.object.isRequired, onMarkAsFailedPress: PropTypes.func.isRequired diff --git a/src/Sonarr.Api.V3/History/HistoryResource.cs b/src/Sonarr.Api.V3/History/HistoryResource.cs index 61f73ccc3..315b1fb3b 100644 --- a/src/Sonarr.Api.V3/History/HistoryResource.cs +++ b/src/Sonarr.Api.V3/History/HistoryResource.cs @@ -19,6 +19,7 @@ namespace Sonarr.Api.V3.History public List Languages { get; set; } public QualityModel Quality { get; set; } public List CustomFormats { get; set; } + public int CustomFormatScore { get; set; } public bool QualityCutoffNotMet { get; set; } public DateTime Date { get; set; } public string DownloadId { get; set; } @@ -40,6 +41,9 @@ namespace Sonarr.Api.V3.History return null; } + var customFormats = formatCalculator.ParseCustomFormat(model, model.Series); + var customFormatScore = model.Series.QualityProfile.Value.CalculateCustomFormatScore(customFormats); + return new HistoryResource { Id = model.Id, @@ -49,7 +53,8 @@ namespace Sonarr.Api.V3.History SourceTitle = model.SourceTitle, Languages = model.Languages, Quality = model.Quality, - CustomFormats = formatCalculator.ParseCustomFormat(model, model.Series).ToResource(false), + CustomFormats = customFormats.ToResource(false), + CustomFormatScore = customFormatScore, // QualityCutoffNotMet Date = model.Date,