1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-27 18:17:13 +00:00
Lidarr/UI/Commands/CommandCollection.js

27 lines
643 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({
url : window.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;
});