New: Show updated Custom Format Score in history

(cherry picked from commit 6dcfc661a12f4c6f03345235fb5531c866666a6a)

Closes #3291
This commit is contained in:
Mark McDowall
2022-12-12 23:48:48 -08:00
committed by Bogdan
parent 8c9d3d09fa
commit e8d3e55b9c
4 changed files with 27 additions and 3 deletions
+6 -1
View File
@@ -19,6 +19,7 @@ namespace Lidarr.Api.V1.History
public string SourceTitle { get; set; }
public QualityModel Quality { get; set; }
public List<CustomFormatResource> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public bool QualityCutoffNotMet { get; set; }
public DateTime Date { get; set; }
public string DownloadId { get; set; }
@@ -41,6 +42,9 @@ namespace Lidarr.Api.V1.History
return null;
}
var customFormats = formatCalculator.ParseCustomFormat(model, model.Artist);
var customFormatScore = model.Artist?.QualityProfile?.Value?.CalculateCustomFormatScore(customFormats) ?? 0;
return new HistoryResource
{
Id = model.Id,
@@ -50,7 +54,8 @@ namespace Lidarr.Api.V1.History
TrackId = model.TrackId,
SourceTitle = model.SourceTitle,
Quality = model.Quality,
CustomFormats = formatCalculator.ParseCustomFormat(model, model.Artist).ToResource(false),
CustomFormats = customFormats.ToResource(false),
CustomFormatScore = customFormatScore,
// QualityCutoffNotMet
Date = model.Date,