1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-25 22:46:31 -04:00

Rename preview for full series and season

New: Preview before renaming files
This commit is contained in:
Mark McDowall
2013-11-26 00:06:28 -08:00
parent bb37444a99
commit e42ac25657
29 changed files with 449 additions and 111 deletions
+38
View File
@@ -0,0 +1,38 @@
'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);
}
});
});