mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-21 01:49:57 +02:00
32 lines
835 B
JavaScript
32 lines
835 B
JavaScript
|
'use strict';
|
||
|
define(
|
||
|
[
|
||
|
'backbone',
|
||
|
'Series/EpisodeFileModel'
|
||
|
], function (Backbone, EpisodeFileModel) {
|
||
|
return Backbone.Collection.extend({
|
||
|
url : window.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);
|
||
|
}
|
||
|
});
|
||
|
});
|