mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 08:33:58 -07:00
signalr cleanup
This commit is contained in:
parent
feda4a9b67
commit
25e2c98c45
219 changed files with 2035 additions and 1495 deletions
|
@ -1,16 +1,21 @@
|
|||
'use strict';
|
||||
define({
|
||||
Execute: function (name, properties) {
|
||||
var data = { command: name };
|
||||
define(
|
||||
[
|
||||
'Commands/CommandModel',
|
||||
'Commands/CommandCollection',
|
||||
'underscore'
|
||||
], function (CommandModel, CommandCollection, _) {
|
||||
|
||||
if (properties) {
|
||||
$.extend(data, properties);
|
||||
return{
|
||||
Execute: function (name, properties) {
|
||||
|
||||
var attr = _.extend({name: name.toLocaleLowerCase()}, properties);
|
||||
|
||||
var commandModel = new CommandModel(attr);
|
||||
|
||||
return commandModel.save().success(function () {
|
||||
CommandCollection.add(commandModel);
|
||||
});
|
||||
}
|
||||
|
||||
return $.ajax({
|
||||
type: 'POST',
|
||||
url : window.ApiRoot + '/command',
|
||||
data: JSON.stringify(data)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue