mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-28 10:37:41 +00:00
21 lines
562 B
JavaScript
21 lines
562 B
JavaScript
'use strict';
|
|
define(
|
|
[
|
|
'Commands/CommandModel',
|
|
'Commands/CommandCollection',
|
|
'underscore'
|
|
], function (CommandModel, CommandCollection, _) {
|
|
|
|
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);
|
|
});
|
|
}
|
|
}
|
|
});
|