2013-08-22 03:56:25 +03:00
|
|
|
'use strict';
|
|
|
|
define(
|
|
|
|
[
|
|
|
|
'backbone',
|
|
|
|
'Series/EpisodeFileModel'
|
|
|
|
], function (Backbone, EpisodeFileModel) {
|
|
|
|
return Backbone.Collection.extend({
|
2013-09-14 10:10:19 +03:00
|
|
|
url : window.NzbDrone.ApiRoot + '/episodefile',
|
2013-08-22 03:56:25 +03:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|