mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-13 02:07:12 -07:00
New: Mass series editor
This commit is contained in:
parent
f76c4700a6
commit
a9ece10144
26 changed files with 606 additions and 34 deletions
|
@ -1,10 +1,11 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'underscore',
|
||||
'backbone',
|
||||
'Series/SeriesModel',
|
||||
'api!series'
|
||||
], function (Backbone, SeriesModel, SeriesData) {
|
||||
], function (_, Backbone, SeriesModel, SeriesData) {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/series',
|
||||
model: SeriesModel,
|
||||
|
@ -16,6 +17,30 @@ define(
|
|||
state: {
|
||||
sortKey: 'title',
|
||||
order : -1
|
||||
},
|
||||
|
||||
save: function () {
|
||||
var self = this;
|
||||
|
||||
var proxy = _.extend( new Backbone.Model(),
|
||||
{
|
||||
id: '',
|
||||
|
||||
url: self.url + '/editor',
|
||||
|
||||
toJSON: function()
|
||||
{
|
||||
return self.filter(function (model) {
|
||||
return model.hasChanged();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.listenTo(proxy, 'sync', function (proxyModel, models) {
|
||||
this.add(models, { merge: true });
|
||||
});
|
||||
|
||||
return proxy.save();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue