mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Remove from queue improvements
New: option to blacklist a release when removing it from download client
This commit is contained in:
@@ -4,10 +4,13 @@ define(
|
||||
[
|
||||
'jquery',
|
||||
'marionette',
|
||||
'Cells/NzbDroneCell'
|
||||
], function ($, Marionette, NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
'Cells/TemplatedCell',
|
||||
'Activity/Queue/RemoveFromQueueView',
|
||||
'vent'
|
||||
], function ($, Marionette, TemplatedCell, RemoveFromQueueView, vent) {
|
||||
return TemplatedCell.extend({
|
||||
|
||||
template : 'Activity/Queue/QueueActionsCellTemplate',
|
||||
className : 'queue-actions-cell',
|
||||
|
||||
events: {
|
||||
@@ -21,48 +24,11 @@ define(
|
||||
grab : '.x-grab'
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
if (this.cellValue) {
|
||||
var status = this.cellValue.get('status').toLowerCase();
|
||||
var trackedDownloadStatus = this.cellValue.has('trackedDownloadStatus') ? this.cellValue.get('trackedDownloadStatus').toLowerCase() : 'ok';
|
||||
var icon = '';
|
||||
var title = '';
|
||||
|
||||
if (status === 'completed' && trackedDownloadStatus === 'warning') {
|
||||
icon = 'icon-inbox x-import';
|
||||
title = 'Force import';
|
||||
}
|
||||
|
||||
if (status === 'pending') {
|
||||
icon = 'icon-download-alt x-grab';
|
||||
title = 'Add to download queue (Override Delay Profile)';
|
||||
}
|
||||
|
||||
//TODO: Show manual import if its completed or option to blacklist
|
||||
//if (trackedDownloadStatus === 'error') {
|
||||
// if (status === 'completed') {
|
||||
// icon = 'icon-nd-import-failed';
|
||||
// title = 'Import failed: ' + itemTitle;
|
||||
// }
|
||||
//TODO: What do we show when waiting for retry to take place?
|
||||
|
||||
// else {
|
||||
// icon = 'icon-nd-download-failed';
|
||||
// title = 'Download failed';
|
||||
// }
|
||||
//}
|
||||
|
||||
this.$el.html('<i class="{0}" title="{1}"></i>'.format(icon, title) +
|
||||
'<i class="icon-nd-delete x-remove" title="Remove from Download Client"></i>');
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_remove : function () {
|
||||
this.model.destroy();
|
||||
|
||||
var showBlacklist = this.model.get('status') !== 'Pending';
|
||||
|
||||
vent.trigger(vent.Commands.OpenModalCommand, new RemoveFromQueueView({ model: this.model, showBlacklist: showBlacklist }));
|
||||
},
|
||||
|
||||
_import : function () {
|
||||
|
Reference in New Issue
Block a user