1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-23 22:25:56 -04:00

New: Custom Format Score column in queue

Closes #5780
This commit is contained in:
jack-mil
2023-07-10 23:49:00 -04:00
committed by GitHub
parent 96b7aa6585
commit a6f2db9139
5 changed files with 39 additions and 2 deletions
+6 -1
View File
@@ -23,6 +23,7 @@ namespace Sonarr.Api.V3.Queue
public List<Language> Languages { get; set; }
public QualityModel Quality { get; set; }
public List<CustomFormatResource> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public decimal Size { get; set; }
public string Title { get; set; }
public decimal Sizeleft { get; set; }
@@ -50,6 +51,9 @@ namespace Sonarr.Api.V3.Queue
return null;
}
var customFormats = model.RemoteEpisode?.CustomFormats;
var customFormatScore = model.Series.QualityProfile.Value.CalculateCustomFormatScore(customFormats);
return new QueueResource
{
Id = model.Id,
@@ -60,7 +64,8 @@ namespace Sonarr.Api.V3.Queue
Episode = includeEpisode && model.Episode != null ? model.Episode.ToResource() : null,
Languages = model.Languages,
Quality = model.Quality,
CustomFormats = model.RemoteEpisode?.CustomFormats?.ToResource(false),
CustomFormats = customFormats?.ToResource(false),
CustomFormatScore = customFormatScore,
Size = model.Size,
Title = model.Title,
Sizeleft = model.Sizeleft,