1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Commands/CommandCollection.js
2013-09-11 17:42:53 -07:00

27 lines
643 B
JavaScript

'use strict';
define(
[
'backbone',
'Commands/CommandModel',
'Mixins/backbone.signalr.mixin'
], function (Backbone, CommandModel) {
var CommandCollection = Backbone.Collection.extend({
url : window.ApiRoot + '/command',
model: CommandModel,
findCommand: function (command) {
return this.find(function (model) {
return model.isSameCommand(command);
});
}
});
var collection = new CommandCollection().bindSignalR();
collection.fetch();
return collection;
});