New: Show tooltips with Custom Formats in History and Queue

Closes #2676
This commit is contained in:
Bogdan
2023-07-17 05:10:28 +03:00
parent 1316b388ad
commit 4bca0d77b7
3 changed files with 32 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ namespace Readarr.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; }
@@ -38,6 +39,9 @@ namespace Readarr.Api.V1.History
return null;
}
var customFormats = formatCalculator.ParseCustomFormat(model, model.Author);
var customFormatScore = model.Author?.QualityProfile?.Value?.CalculateCustomFormatScore(customFormats) ?? 0;
return new HistoryResource
{
Id = model.Id,
@@ -46,7 +50,8 @@ namespace Readarr.Api.V1.History
AuthorId = model.AuthorId,
SourceTitle = model.SourceTitle,
Quality = model.Quality,
CustomFormats = formatCalculator.ParseCustomFormat(model, model.Author).ToResource(false),
CustomFormats = customFormats.ToResource(false),
CustomFormatScore = customFormatScore,
//QualityCutoffNotMet
Date = model.Date,