mirror of https://github.com/lidarr/Lidarr
New: Show warning for queue when there is a warning
This commit is contained in:
parent
f6e4ccda84
commit
f8fb37bae8
|
@ -16,8 +16,6 @@ define(
|
|||
if (this.cellValue) {
|
||||
var status = this.cellValue.get('status').toLowerCase();
|
||||
var trackedDownloadStatus = this.cellValue.get('trackedDownloadStatus').toLowerCase();
|
||||
var hasError = this.cellValue.get('hasError') || false;
|
||||
var hasWarning = this.cellValue.get('hasWarning') || false;
|
||||
var icon = 'icon-nd-downloading';
|
||||
var title = 'Downloading';
|
||||
var itemTitle = this.cellValue.get('title');
|
||||
|
@ -55,7 +53,6 @@ define(
|
|||
|
||||
if (trackedDownloadStatus === 'warning') {
|
||||
icon += ' icon-nd-warning';
|
||||
// title = 'Download failed';
|
||||
|
||||
this.templateFunction = Marionette.TemplateCache.get(this.template);
|
||||
content = this.templateFunction(this.cellValue.toJSON());
|
||||
|
|
|
@ -22,14 +22,23 @@ define(
|
|||
|
||||
var count = QueueCollection.fullCollection.length;
|
||||
var label = 'label-info';
|
||||
|
||||
var errors = QueueCollection.fullCollection.some(function (model) {
|
||||
return model.has('errorMessage');
|
||||
return model.get('trackedDownloadStatus').toLowerCase() === 'error';
|
||||
});
|
||||
|
||||
var warnings = QueueCollection.fullCollection.some(function (model) {
|
||||
return model.get('trackedDownloadStatus').toLowerCase() === 'warning';
|
||||
});
|
||||
|
||||
if (errors) {
|
||||
label = 'label-danger';
|
||||
}
|
||||
|
||||
else if (warnings) {
|
||||
label = 'label-warning';
|
||||
}
|
||||
|
||||
this.$el.html('<span class="label {0}">{1}</span>'.format(label, count));
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue