|
|
@ -3,7 +3,6 @@ define(
|
|
|
|
[
|
|
|
|
[
|
|
|
|
'app',
|
|
|
|
'app',
|
|
|
|
'marionette',
|
|
|
|
'marionette',
|
|
|
|
|
|
|
|
|
|
|
|
'Quality/QualityProfileCollection',
|
|
|
|
'Quality/QualityProfileCollection',
|
|
|
|
'AddSeries/RootFolders/Collection',
|
|
|
|
'AddSeries/RootFolders/Collection',
|
|
|
|
'AddSeries/RootFolders/Layout',
|
|
|
|
'AddSeries/RootFolders/Layout',
|
|
|
@ -15,13 +14,14 @@ define(
|
|
|
|
|
|
|
|
|
|
|
|
return Marionette.ItemView.extend({
|
|
|
|
return Marionette.ItemView.extend({
|
|
|
|
|
|
|
|
|
|
|
|
template: 'AddSeries/SearchResultTemplate',
|
|
|
|
template: 'AddSeries/SearchResultViewTemplate',
|
|
|
|
|
|
|
|
|
|
|
|
ui: {
|
|
|
|
ui: {
|
|
|
|
qualityProfile: '.x-quality-profile',
|
|
|
|
qualityProfile: '.x-quality-profile',
|
|
|
|
rootFolder : '.x-root-folder',
|
|
|
|
rootFolder : '.x-root-folder',
|
|
|
|
addButton : '.x-add',
|
|
|
|
addButton : '.x-add',
|
|
|
|
overview : '.x-overview'
|
|
|
|
overview : '.x-overview',
|
|
|
|
|
|
|
|
startingSeason: '.x-starting-season'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
events: {
|
|
|
|
events: {
|
|
|
@ -57,6 +57,12 @@ define(
|
|
|
|
this.ui.rootFolder.val(defaultRoot);
|
|
|
|
this.ui.rootFolder.val(defaultRoot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var minSeasonNotZero = _.min(_.reject(this.model.get('seasons'), { seasonNumber: 0 }), 'seasonNumber');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (minSeasonNotZero) {
|
|
|
|
|
|
|
|
this.ui.startingSeason.val(minSeasonNotZero.seasonNumber);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: make this work via onRender, FM?
|
|
|
|
//TODO: make this work via onRender, FM?
|
|
|
|
//works with onShow, but stops working after the first render
|
|
|
|
//works with onShow, but stops working after the first render
|
|
|
|
this.ui.overview.dotdotdot({
|
|
|
|
this.ui.overview.dotdotdot({
|
|
|
@ -117,15 +123,16 @@ define(
|
|
|
|
|
|
|
|
|
|
|
|
var quality = this.ui.qualityProfile.val();
|
|
|
|
var quality = this.ui.qualityProfile.val();
|
|
|
|
var rootFolderPath = this.ui.rootFolder.children(':selected').text();
|
|
|
|
var rootFolderPath = this.ui.rootFolder.children(':selected').text();
|
|
|
|
|
|
|
|
var startingSeason = this.ui.startingSeason.val();
|
|
|
|
|
|
|
|
|
|
|
|
this.model.set('qualityProfileId', quality);
|
|
|
|
this.model.set('qualityProfileId', quality);
|
|
|
|
this.model.set('rootFolderPath', rootFolderPath);
|
|
|
|
this.model.set('rootFolderPath', rootFolderPath);
|
|
|
|
|
|
|
|
this.model.setSeasonPass(startingSeason);
|
|
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
|
|
SeriesCollection.add(this.model);
|
|
|
|
SeriesCollection.add(this.model);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.model.save().done(function () {
|
|
|
|
this.model.save().done(function () {
|
|
|
|
self.close();
|
|
|
|
self.close();
|
|
|
|
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
|
|
|
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
|
|
|