New: Show updated Custom Format Score in history
(cherry picked from commit 6dcfc661a12f4c6f03345235fb5531c866666a6a) Closes #3291
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user