|
|
@ -3,22 +3,24 @@ define(
|
|
|
|
[
|
|
|
|
[
|
|
|
|
'underscore',
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
|
|
|
'backbone',
|
|
|
|
|
|
|
|
'backbone.pageable',
|
|
|
|
'Series/SeriesModel',
|
|
|
|
'Series/SeriesModel',
|
|
|
|
'api!series'
|
|
|
|
'api!series',
|
|
|
|
], function (_, Backbone, SeriesModel, SeriesData) {
|
|
|
|
'Mixins/AsPersistedStateCollection'
|
|
|
|
|
|
|
|
], function (_, Backbone, PageableCollection, SeriesModel, SeriesData, AsPersistedStateCollection) {
|
|
|
|
var Collection = Backbone.Collection.extend({
|
|
|
|
var Collection = Backbone.Collection.extend({
|
|
|
|
url : window.NzbDrone.ApiRoot + '/series',
|
|
|
|
url : window.NzbDrone.ApiRoot + '/series',
|
|
|
|
model: SeriesModel,
|
|
|
|
model: SeriesModel,
|
|
|
|
|
|
|
|
tableName: 'series',
|
|
|
|
comparator: function (model) {
|
|
|
|
|
|
|
|
return model.get('title');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state: {
|
|
|
|
state: {
|
|
|
|
sortKey: 'title',
|
|
|
|
sortKey: 'title',
|
|
|
|
order : 'ascending'
|
|
|
|
order : -1,
|
|
|
|
|
|
|
|
pageSize: 1000
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mode: 'client',
|
|
|
|
|
|
|
|
|
|
|
|
save: function () {
|
|
|
|
save: function () {
|
|
|
|
var self = this;
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
|
@ -31,7 +33,7 @@ define(
|
|
|
|
toJSON: function()
|
|
|
|
toJSON: function()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return self.filter(function (model) {
|
|
|
|
return self.filter(function (model) {
|
|
|
|
return model.hasChanged();
|
|
|
|
return model.edited;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -45,6 +47,7 @@ define(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var collection = new Collection(SeriesData);
|
|
|
|
var mixedIn = AsPersistedStateCollection.call(Collection);
|
|
|
|
|
|
|
|
var collection = new mixedIn(SeriesData);
|
|
|
|
return collection;
|
|
|
|
return collection;
|
|
|
|
});
|
|
|
|
});
|
|
|
|