1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-26 22:46:53 -04:00

Second Pass at rename/organize

This commit is contained in:
Tim Turner
2017-01-08 17:01:37 -05:00
parent cd4863b974
commit b5d932866a
18 changed files with 384 additions and 52 deletions
+45 -10
View File
@@ -1,3 +1,38 @@
// var Backbone = require('backbone');
// var RenamePreviewModel = require('./RenamePreviewModel');
// module.exports = 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 !== undefined) {
// options.data.seasonNumber = this.seasonNumber;
// }
// return this.originalFetch.call(this, options);
// }
// });
var Backbone = require('backbone');
var RenamePreviewModel = require('./RenamePreviewModel');
@@ -8,26 +43,26 @@ module.exports = Backbone.Collection.extend({
originalFetch : Backbone.Collection.prototype.fetch,
initialize : function(options) {
if (!options.seriesId) {
throw 'seriesId is required';
if (!options.movieId) {
throw 'movieId is required';
}
this.seriesId = options.seriesId;
this.seasonNumber = options.seasonNumber;
this.movieId = options.movieId;
//this.seasonNumber = options.seasonNumber;
},
fetch : function(options) {
if (!this.seriesId) {
throw 'seriesId is required';
if (!this.movieId) {
throw 'movieId is required';
}
options = options || {};
options.data = {};
options.data.seriesId = this.seriesId;
options.data.movieId = this.movieId;
if (this.seasonNumber !== undefined) {
options.data.seasonNumber = this.seasonNumber;
}
// if (this.seasonNumber !== undefined) {
// options.data.seasonNumber = this.seasonNumber;
//}
return this.originalFetch.call(this, options);
}