Queue UI no longer shows unknown ETAs as 0:00:00.

pull/2/head
Taloth Saldono 11 years ago
parent f304ad50d1
commit cb0f7792f2

@ -13,7 +13,7 @@ namespace NzbDrone.Api.Queue
public Decimal Size { get; set; } public Decimal Size { get; set; }
public String Title { get; set; } public String Title { get; set; }
public Decimal Sizeleft { get; set; } public Decimal Sizeleft { get; set; }
public TimeSpan Timeleft { get; set; } public TimeSpan? Timeleft { get; set; }
public String Status { get; set; } public String Status { get; set; }
} }
} }

@ -15,8 +15,8 @@ namespace NzbDrone.Core.Download
public Int64 TotalSize { get; set; } public Int64 TotalSize { get; set; }
public Int64 RemainingSize { get; set; } public Int64 RemainingSize { get; set; }
public TimeSpan DownloadTime { get; set; } public TimeSpan? DownloadTime { get; set; }
public TimeSpan RemainingTime { get; set; } public TimeSpan? RemainingTime { get; set; }
public String OutputPath { get; set; } public String OutputPath { get; set; }
public String Message { get; set; } public String Message { get; set; }

@ -14,7 +14,7 @@ namespace NzbDrone.Core.Queue
public Decimal Size { get; set; } public Decimal Size { get; set; }
public String Title { get; set; } public String Title { get; set; }
public Decimal Sizeleft { get; set; } public Decimal Sizeleft { get; set; }
public TimeSpan Timeleft { get; set; } public TimeSpan? Timeleft { get; set; }
public String Status { get; set; } public String Status { get; set; }
public RemoteEpisode RemoteEpisode { get; set; } public RemoteEpisode RemoteEpisode { get; set; }
} }

@ -24,7 +24,10 @@ namespace NzbDrone.Core.Queue
public List<Queue> GetQueue() public List<Queue> GetQueue()
{ {
var queueItems = _downloadTrackingService.GetQueuedDownloads().Select(v => v.DownloadItem).ToList(); var queueItems = _downloadTrackingService.GetQueuedDownloads()
.Select(v => v.DownloadItem)
.OrderBy(v => v.RemainingTime)
.ToList();
return MapQueue(queueItems); return MapQueue(queueItems);
} }

@ -137,6 +137,7 @@ td.episode-status-cell, td.quality-cell {
.timeleft-cell { .timeleft-cell {
cursor : default; cursor : default;
width : 80px; width : 80px;
text-align: center;
} }
.queue-status-cell { .queue-status-cell {

@ -2,8 +2,9 @@
define( define(
[ [
'Cells/NzbDroneCell' 'Cells/NzbDroneCell',
], function (NzbDroneCell) { 'filesize'
], function (NzbDroneCell, fileSize) {
return NzbDroneCell.extend({ return NzbDroneCell.extend({
className: 'timeleft-cell', className: 'timeleft-cell',
@ -14,11 +15,15 @@ define(
if (this.cellValue) { if (this.cellValue) {
var timeleft = this.cellValue.get('timeleft'); var timeleft = this.cellValue.get('timeleft');
var size = this.cellValue.get('size'); var totalSize = fileSize(this.cellValue.get('size'), 1, false);
var sizeleft = this.cellValue.get('sizeleft'); var remainingSize = fileSize(this.cellValue.get('sizeleft'), 1, false);
this.$el.html(timeleft); if (timeleft === undefined) {
this.$el.attr('title', '{0} MB / {1} MB'.format(sizeleft, size)); this.$el.html("-");
} else {
this.$el.html(timeleft);
}
this.$el.attr('title', '{0} / {1}'.format(remainingSize, totalSize));
} }
return this; return this;

Loading…
Cancel
Save