Lidarr/UI/Commands/CommandCollection.js

27 lines
652 B
JavaScript
Raw Normal View History

2013-09-11 06:33:47 +00:00
'use strict';
define(
[
'backbone',
'Commands/CommandModel',
'Mixins/backbone.signalr.mixin'
], function (Backbone, CommandModel) {
var CommandCollection = Backbone.Collection.extend({
2013-09-14 07:10:19 +00:00
url : window.NzbDrone.ApiRoot + '/command',
2013-09-11 06:33:47 +00:00
model: CommandModel,
findCommand: function (command) {
return this.find(function (model) {
return model.isSameCommand(command);
});
}
});
var collection = new CommandCollection().bindSignalR();
2013-09-11 06:33:47 +00:00
collection.fetch();
return collection;
});