mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-24 22:35:49 -04:00
Deprecate Sizeleft and Timeleft queue item properties
Rename SizeLeft and TimeLeft queue item properties (cherry picked from commit b51a49097941e5f306cae5785c63985b319784fd) Fixed: Error loading queue (cherry picked from commit f9606518eef78117f1e06a8bcc34af57ab0d2454)
This commit is contained in:
@@ -214,8 +214,8 @@ namespace Radarr.Api.V3.Queue
|
||||
if (pagingSpec.SortKey == "timeleft")
|
||||
{
|
||||
ordered = ascending
|
||||
? fullQueue.OrderBy(q => q.Timeleft, new TimeleftComparer())
|
||||
: fullQueue.OrderByDescending(q => q.Timeleft, new TimeleftComparer());
|
||||
? fullQueue.OrderBy(q => q.TimeLeft, new TimeleftComparer())
|
||||
: fullQueue.OrderByDescending(q => q.TimeLeft, new TimeleftComparer());
|
||||
}
|
||||
else if (pagingSpec.SortKey == "estimatedCompletionTime")
|
||||
{
|
||||
@@ -266,7 +266,7 @@ namespace Radarr.Api.V3.Queue
|
||||
ordered = ascending ? fullQueue.OrderBy(orderByFunc) : fullQueue.OrderByDescending(orderByFunc);
|
||||
}
|
||||
|
||||
ordered = ordered.ThenByDescending(q => q.Size == 0 ? 0 : 100 - (q.Sizeleft / q.Size * 100));
|
||||
ordered = ordered.ThenByDescending(q => q.Size == 0 ? 0 : 100 - (q.SizeLeft / q.Size * 100));
|
||||
|
||||
pagingSpec.Records = ordered.Skip((pagingSpec.Page - 1) * pagingSpec.PageSize).Take(pagingSpec.PageSize).ToList();
|
||||
pagingSpec.TotalRecords = fullQueue.Count;
|
||||
@@ -300,9 +300,9 @@ namespace Radarr.Api.V3.Queue
|
||||
return q => q.Size;
|
||||
case "progress":
|
||||
// Avoid exploding if a download's size is 0
|
||||
return q => 100 - (q.Sizeleft / Math.Max(q.Size * 100, 1));
|
||||
return q => 100 - (q.SizeLeft / Math.Max(q.Size * 100, 1));
|
||||
default:
|
||||
return q => q.Timeleft;
|
||||
return q => q.TimeLeft;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user