mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Moved source code under src folder - massive change
This commit is contained in:
parent
2fc8123d6b
commit
5bf0e197ec
1499 changed files with 1054 additions and 1444 deletions
37
src/UI/Commands/CommandModel.js
Normal file
37
src/UI/Commands/CommandModel.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
url: window.NzbDrone.ApiRoot + '/command',
|
||||
|
||||
parse: function (response) {
|
||||
response.name = response.name.toLocaleLowerCase();
|
||||
return response;
|
||||
},
|
||||
|
||||
isSameCommand: function (command) {
|
||||
|
||||
if (command.name.toLocaleLowerCase() !== this.get('name').toLocaleLowerCase()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var key in command) {
|
||||
if (key !== 'name' && command[key] !== this.get(key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
isActive: function () {
|
||||
return this.get('state') !== 'completed' && this.get('state') !== 'failed';
|
||||
},
|
||||
|
||||
isComplete: function () {
|
||||
return this.get('state') === 'completed';
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue