UI Cleanup - Updated Rename and SeasonPass subtrees.

This commit is contained in:
Taloth Saldono
2015-02-13 22:52:55 +01:00
parent 860f55996c
commit 1bf433872a
11 changed files with 233 additions and 145 deletions

View File

@@ -2,26 +2,33 @@ var Backbone = require('backbone');
var RenamePreviewModel = require('./RenamePreviewModel');
module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/rename',
model : RenamePreviewModel,
url : window.NzbDrone.ApiRoot + '/rename',
model : RenamePreviewModel,
originalFetch : Backbone.Collection.prototype.fetch,
initialize : function(options){
if(!options.seriesId) {
initialize : function(options) {
if (!options.seriesId) {
throw 'seriesId is required';
}
this.seriesId = options.seriesId;
this.seasonNumber = options.seasonNumber;
},
fetch : function(options){
if(!this.seriesId) {
fetch : function(options) {
if (!this.seriesId) {
throw 'seriesId is required';
}
options = options || {};
options.data = {};
options.data.seriesId = this.seriesId;
if(this.seasonNumber) {
if (this.seasonNumber) {
options.data.seasonNumber = this.seasonNumber;
}
return this.originalFetch.call(this, options);
}
});