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

This commit is contained in:
Taloth Saldono 2014-05-24 12:50:34 +02:00
parent f304ad50d1
commit cb0f7792f2
6 changed files with 20 additions and 11 deletions

View File

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

View File

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

View File

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

View File

@ -24,7 +24,10 @@ namespace NzbDrone.Core.Queue
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);
}

View File

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

View File

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