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

27 lines
652 B
JavaScript
Raw Normal View History

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