mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
Added commands to delete logs and log files (separately)
This commit is contained in:
parent
e152ecc55d
commit
1274c1c144
12 changed files with 191 additions and 28 deletions
|
@ -44,8 +44,9 @@ define(
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
invokeCommand: function () {
|
||||
//TODO: Use Actioneer to handle icon swapping
|
||||
|
||||
var command = this.model.get('command');
|
||||
if (command) {
|
||||
this.idle = false;
|
||||
|
@ -60,18 +61,35 @@ define(
|
|||
message: self.model.get('successMessage')
|
||||
});
|
||||
}
|
||||
|
||||
if (self.model.get('successCallback')) {
|
||||
if (!self.model.ownerContext) {
|
||||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
self.model.get('successCallback').call(self.model.ownerContext);
|
||||
}
|
||||
});
|
||||
|
||||
commandPromise.fail(function (options) {
|
||||
if (options.readyState === 0 || options.status === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.model.get('errorMessage')) {
|
||||
Messenger.show({
|
||||
message: self.model.get('errorMessage'),
|
||||
type : 'error'
|
||||
});
|
||||
}
|
||||
|
||||
if (self.model.get('failCallback')) {
|
||||
if (!self.model.ownerContext) {
|
||||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
self.model.get('failCallback').call(self.model.ownerContext);
|
||||
}
|
||||
});
|
||||
|
||||
commandPromise.always(function () {
|
||||
|
@ -81,6 +99,14 @@ define(
|
|||
self.idle = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (self.model.get('alwaysCallback')) {
|
||||
if (!self.model.ownerContext) {
|
||||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
self.model.get('alwaysCallback').call(self.model.ownerContext);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -103,7 +129,6 @@ define(
|
|||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
|
||||
var callback = this.model.get('callback');
|
||||
if (callback) {
|
||||
callback.call(this.model.ownerContext);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue