mirror of
https://github.com/Radarr/Radarr
synced 2025-12-24 17:23:26 +01:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
'use strict';
|
|
define(
|
|
[
|
|
'backbone',
|
|
'Rename/RenamePreviewModel'
|
|
], function (Backbone, RenamePreviewModel) {
|
|
return Backbone.Collection.extend({
|
|
url : window.NzbDrone.ApiRoot + '/rename',
|
|
model: RenamePreviewModel,
|
|
|
|
originalFetch: Backbone.Collection.prototype.fetch,
|
|
|
|
initialize: function (options) {
|
|
if (!options.seriesId) {
|
|
throw 'seriesId is required';
|
|
}
|
|
|
|
this.seriesId = options.seriesId;
|
|
this.seasonNumber = options.seasonNumber;
|
|
},
|
|
|
|
fetch: function (options) {
|
|
if (!this.seriesId) {
|
|
throw 'seriesId is required';
|
|
}
|
|
|
|
options = options || {};
|
|
options.data = {};
|
|
options.data.seriesId = this.seriesId;
|
|
|
|
if (this.seasonNumber) {
|
|
options.data.seasonNumber = this.seasonNumber;
|
|
}
|
|
|
|
return this.originalFetch.call(this, options);
|
|
}
|
|
});
|
|
});
|