mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 06:45:19 -07:00
add importfromlist abck
This commit is contained in:
parent
09fb58c3e9
commit
c3c7387390
1 changed files with 21 additions and 0 deletions
|
@ -47,6 +47,27 @@ var Collection = PageableCollection.extend({
|
||||||
return proxy.save();
|
return proxy.save();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
importFromList : function(models) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
var proxy = _.extend(new Backbone.Model(), {
|
||||||
|
id : "",
|
||||||
|
|
||||||
|
url : self.url + "/import",
|
||||||
|
|
||||||
|
toJSON : function() {
|
||||||
|
return models;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.listenTo(proxy, "sync", function(proxyModel, models) {
|
||||||
|
this.add(models, { merge : true});
|
||||||
|
this.trigger("save", this);
|
||||||
|
});
|
||||||
|
|
||||||
|
return proxy.save();
|
||||||
|
},
|
||||||
|
|
||||||
filterModes : {
|
filterModes : {
|
||||||
'all' : [
|
'all' : [
|
||||||
null,
|
null,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue