1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-25 02:30:20 +02:00
Sonarr/src/UI/Series/EpisodeFileCollection.js
2013-10-02 18:01:32 -07:00

32 lines
844 B
JavaScript

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