You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/UI/Series/EpisodeFileCollection.js

28 lines
687 B

var Backbone = require('backbone');
var EpisodeFileModel = require('./EpisodeFileModel');
module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/episodefile',
model : EpisodeFileModel,
originalFetch : Backbone.Collection.prototype.fetch,
initialize : function(options) {
this.seriesId = options.seriesId;
this.models = [];
},
fetch : function(options) {
if (!this.seriesId) {
throw 'seriesId is required';
}
if (!options) {
options = {};
}
options.data = { seriesId : this.seriesId };
return this.originalFetch.call(this, options);
}
});