Renmed Downloading on EpisodeResource to Grabbed (also hidden by default)

pull/6/head
Mark McDowall 11 years ago
parent 435fa927ee
commit ab05aabcd8

@ -59,7 +59,7 @@ namespace NzbDrone.Api.Calendar
foreach (var episode in message.Episode.Episodes)
{
var resource = episode.InjectTo<EpisodeResource>();
resource.Downloading = true;
resource.Grabbed = true;
BroadcastResourceChange(ModelAction.Updated, resource);
}

@ -54,7 +54,7 @@ namespace NzbDrone.Api.Episodes
foreach (var episode in message.Episode.Episodes)
{
var resource = episode.InjectTo<EpisodeResource>();
resource.Downloading = true;
resource.Grabbed = true;
BroadcastResourceChange(ModelAction.Updated, resource);
}

@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using NzbDrone.Api.REST;
using NzbDrone.Core.MediaFiles;
@ -27,6 +28,8 @@ namespace NzbDrone.Api.Episodes
public Core.Tv.Series Series { get; set; }
public String SeriesTitle { get; set; }
public Boolean Downloading { get; set; }
//Hiding this so people don't think its usable (only used to set the initial state)
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public Boolean Grabbed { get; set; }
}
}

@ -106,7 +106,7 @@ define(
_getStatusLevel: function (element, endTime) {
var hasFile = element.get('hasFile');
var downloading = QueueCollection.findEpisode(element.get('id')) || element.get('downloading');
var downloading = QueueCollection.findEpisode(element.get('id')) || element.get('grabbed');
var currentTime = moment();
var start = moment(element.get('airDateUtc'));
var end = moment(endTime);

@ -69,12 +69,19 @@ define(
if (downloading) {
var progress = 100 - (downloading.get('sizeleft') / downloading.get('size') * 100);
this.$el.html('<div class="progress progress-purple" title="Episode is downloading - {0}% {1}">'.format(progress.toFixed(1), downloading.get('title')) +
'<div class="bar" style="width: {0}%;"></div></div>'.format(progress));
return;
if (progress === 0) {
icon = 'icon-nd-downloading';
tooltip = 'Episode is downloading';
}
else {
this.$el.html('<div class="progress" title="Episode is downloading - {0}% {1}">'.format(progress.toFixed(1), downloading.get('title')) +
'<div class="progress-bar progress-bar-purple" style="width: {0}%;"></div></div>'.format(progress));
return;
}
}
else if (this.model.get('downloading')) {
else if (this.model.get('grabbed')) {
icon = 'icon-nd-downloading';
tooltip = 'Episode is downloading';
}

@ -34,6 +34,6 @@
}
}
.progress-purple .bar, .progress .bar-purple {
.progress-bar-purple {
#gradient > .vertical(@purple, @nzbdronePurple);
}

Loading…
Cancel
Save