mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Queue should update now
This commit is contained in:
parent
938b5f1ae3
commit
6f27d8c33f
@ -14,5 +14,6 @@ public class QueueResource : RestResource
|
||||
public String Title { get; set; }
|
||||
public Decimal Sizeleft { get; set; }
|
||||
public TimeSpan Timeleft { get; set; }
|
||||
public String Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public virtual IEnumerable<QueueItem> GetQueue()
|
||||
queueItem.Id = nzbGetQueueItem.NzbId.ToString();
|
||||
queueItem.Title = nzbGetQueueItem.NzbName;
|
||||
queueItem.Size = nzbGetQueueItem.FileSizeMb;
|
||||
queueItem.SizeLeft = nzbGetQueueItem.RemainingSizeMb;
|
||||
queueItem.Sizeleft = nzbGetQueueItem.RemainingSizeMb;
|
||||
|
||||
yield return queueItem;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class SabQueueItem
|
||||
public string Category { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "mbleft")]
|
||||
public decimal SizeLeft { get; set; }
|
||||
public decimal Sizeleft { get; set; }
|
||||
|
||||
public int Percentage { get; set; }
|
||||
|
||||
|
@ -117,9 +117,11 @@ public IEnumerable<QueueItem> GetQueue()
|
||||
queueItem.Id = sabQueueItem.Id;
|
||||
queueItem.Title = sabQueueItem.Title;
|
||||
queueItem.Size = sabQueueItem.Size;
|
||||
queueItem.SizeLeft = sabQueueItem.Size;
|
||||
queueItem.Sizeleft = sabQueueItem.Sizeleft;
|
||||
queueItem.Timeleft = sabQueueItem.Timeleft;
|
||||
queueItem.Status = sabQueueItem.Status;
|
||||
|
||||
queueItems.Add( queueItem);
|
||||
queueItems.Add(queueItem);
|
||||
}
|
||||
|
||||
return queueItems;
|
||||
|
@ -7,7 +7,8 @@ public class QueueItem
|
||||
public string Id { get; set; }
|
||||
public decimal Size { get; set; }
|
||||
public string Title { get; set; }
|
||||
public decimal SizeLeft { get; set; }
|
||||
public decimal Sizeleft { get; set; }
|
||||
public TimeSpan Timeleft { get; set; }
|
||||
public String Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,5 +13,6 @@ public class Queue : ModelBase
|
||||
public String Title { get; set; }
|
||||
public Decimal Sizeleft { get; set; }
|
||||
public TimeSpan Timeleft { get; set; }
|
||||
public String Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -59,8 +59,9 @@ private List<Queue> MapQueue(IEnumerable<QueueItem> queueItems)
|
||||
queue.Quality = remoteEpisode.ParsedEpisodeInfo.Quality;
|
||||
queue.Title = queueItem.Title;
|
||||
queue.Size = queueItem.Size;
|
||||
queue.Sizeleft = queueItem.SizeLeft;
|
||||
queue.Sizeleft = queueItem.Sizeleft;
|
||||
queue.Timeleft = queueItem.Timeleft;
|
||||
queue.Status = queueItem.Status;
|
||||
queued.Add(queue);
|
||||
}
|
||||
}
|
||||
|
@ -97,3 +97,8 @@ td.episode-status-cell, td.quality-cell {
|
||||
cursor: default;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.queue-status-cell {
|
||||
width: 20px;
|
||||
text-align: center !important;
|
||||
}
|
@ -8,6 +8,7 @@ define(
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/QualityCell',
|
||||
'History/Queue/QueueStatusCell',
|
||||
'History/Queue/TimeleftCell'
|
||||
], function (Marionette,
|
||||
Backgrid,
|
||||
@ -16,6 +17,7 @@ define(
|
||||
EpisodeNumberCell,
|
||||
EpisodeTitleCell,
|
||||
QualityCell,
|
||||
QueueStatusCell,
|
||||
TimeleftCell) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'History/Queue/QueueLayoutTemplate',
|
||||
@ -26,6 +28,12 @@ define(
|
||||
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'status',
|
||||
label: '',
|
||||
cell : QueueStatusCell,
|
||||
cellValue: 'this'
|
||||
},
|
||||
{
|
||||
name : 'series',
|
||||
label: 'Series',
|
||||
|
39
src/UI/History/Queue/QueueStatusCell.js
Normal file
39
src/UI/History/Queue/QueueStatusCell.js
Normal file
@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'queue-status-cell',
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
if (this.cellValue) {
|
||||
var status = this.cellValue.get('status').toLowerCase();
|
||||
var icon = 'icon-nd-downloading';
|
||||
var title = 'Downloading';
|
||||
|
||||
if (status === 'paused') {
|
||||
icon = 'icon-pause';
|
||||
title = 'Paused';
|
||||
}
|
||||
|
||||
if (status === 'queued') {
|
||||
icon = 'icon-cloud';
|
||||
title = 'Queued';
|
||||
}
|
||||
|
||||
var timeleft = this.cellValue.get('timeleft');
|
||||
var size = this.cellValue.get('size');
|
||||
var sizeleft = this.cellValue.get('sizeleft');
|
||||
|
||||
this.$el.html('<i class="{0}" title="{1}"></i>'.format(icon, title));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
@ -22,7 +22,7 @@ define(function () {
|
||||
}
|
||||
if (xhr) {
|
||||
xhr.headers = xhr.headers || {};
|
||||
xhr.headers['Authorization'] = window.NzbDrone.ApiKey;
|
||||
// xhr.headers.Authorization = window.NzbDrone.ApiKey;
|
||||
}
|
||||
|
||||
return original.apply(this, arguments);
|
||||
|
Loading…
Reference in New Issue
Block a user