mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Almost finished linking frontend to backend. A few issues with DB mapping to work out.
This commit is contained in:
@@ -18,25 +18,29 @@ var view = Marionette.ItemView.extend({
|
||||
template : 'AddSeries/SearchResultViewTemplate',
|
||||
|
||||
ui : {
|
||||
profile : '.x-profile',
|
||||
rootFolder : '.x-root-folder',
|
||||
seasonFolder : '.x-season-folder',
|
||||
seriesType : '.x-series-type',
|
||||
monitor : '.x-monitor',
|
||||
monitorTooltip : '.x-monitor-tooltip',
|
||||
addButton : '.x-add',
|
||||
addSearchButton : '.x-add-search',
|
||||
overview : '.x-overview'
|
||||
profile : '.x-profile',
|
||||
rootFolder : '.x-root-folder',
|
||||
seasonFolder : '.x-season-folder',
|
||||
seriesType : '.x-series-type',
|
||||
monitor : '.x-monitor',
|
||||
monitorTooltip : '.x-monitor-tooltip',
|
||||
addButton : '.x-add',
|
||||
addAlbumButton : '.x-add-album',
|
||||
addSearchButton : '.x-add-search',
|
||||
addAlbumSearchButton : '.x-add-album-search',
|
||||
overview : '.x-overview'
|
||||
},
|
||||
|
||||
events : {
|
||||
'click .x-add' : '_addWithoutSearch',
|
||||
'click .x-add-search' : '_addAndSearch',
|
||||
'change .x-profile' : '_profileChanged',
|
||||
'change .x-root-folder' : '_rootFolderChanged',
|
||||
'change .x-season-folder' : '_seasonFolderChanged',
|
||||
'change .x-series-type' : '_seriesTypeChanged',
|
||||
'change .x-monitor' : '_monitorChanged'
|
||||
'click .x-add' : '_addWithoutSearch',
|
||||
'click .x-add-album' : '_addWithoutSearch',
|
||||
'click .x-add-search' : '_addAndSearch',
|
||||
'click .x-add-album-search' : '_addAndSearch',
|
||||
'change .x-profile' : '_profileChanged',
|
||||
'change .x-root-folder' : '_rootFolderChanged',
|
||||
'change .x-season-folder' : '_seasonFolderChanged',
|
||||
'change .x-series-type' : '_seriesTypeChanged',
|
||||
'change .x-monitor' : '_monitorChanged'
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
@@ -161,7 +165,8 @@ var view = Marionette.ItemView.extend({
|
||||
this._rootFolderChanged();
|
||||
},
|
||||
|
||||
_addWithoutSearch : function() {
|
||||
_addWithoutSearch : function(evt) {
|
||||
console.log(evt);
|
||||
this._addSeries(false);
|
||||
},
|
||||
|
||||
@@ -171,8 +176,8 @@ var view = Marionette.ItemView.extend({
|
||||
|
||||
_addSeries : function(searchForMissing) {
|
||||
// TODO: Refactor to handle multiple add buttons/albums
|
||||
var addButton = this.ui.addButton[0];
|
||||
var addSearchButton = this.ui.addSearchButton[0];
|
||||
var addButton = this.ui.addButton;
|
||||
var addSearchButton = this.ui.addSearchButton;
|
||||
console.log('_addSeries, searchForMissing=', searchForMissing);
|
||||
|
||||
addButton.addClass('disabled');
|
||||
@@ -221,7 +226,7 @@ var view = Marionette.ItemView.extend({
|
||||
message : 'Added: ' + self.model.get('title'),
|
||||
actions : {
|
||||
goToSeries : {
|
||||
label : 'Go to Series',
|
||||
label : 'Go to Artist',
|
||||
action : function() {
|
||||
Backbone.history.navigate('/artist/' + self.model.get('titleSlug'), { trigger : true });
|
||||
}
|
||||
@@ -246,7 +251,7 @@ var view = Marionette.ItemView.extend({
|
||||
var lastSeason = _.max(this.model.get('seasons'), 'seasonNumber');
|
||||
var firstSeason = _.min(_.reject(this.model.get('seasons'), { seasonNumber : 0 }), 'seasonNumber');
|
||||
|
||||
this.model.setSeasonPass(firstSeason.seasonNumber);
|
||||
//this.model.setSeasonPass(firstSeason.seasonNumber); // TODO
|
||||
|
||||
var options = {
|
||||
ignoreEpisodesWithFiles : false,
|
||||
@@ -262,14 +267,14 @@ var view = Marionette.ItemView.extend({
|
||||
options.ignoreEpisodesWithoutFiles = true;
|
||||
}
|
||||
|
||||
else if (monitor === 'latest') {
|
||||
/*else if (monitor === 'latest') {
|
||||
this.model.setSeasonPass(lastSeason.seasonNumber);
|
||||
}
|
||||
|
||||
else if (monitor === 'first') {
|
||||
this.model.setSeasonPass(lastSeason.seasonNumber + 1);
|
||||
this.model.setSeasonMonitored(firstSeason.seasonNumber);
|
||||
}
|
||||
}*/
|
||||
|
||||
else if (monitor === 'missing') {
|
||||
options.ignoreEpisodesWithFiles = true;
|
||||
@@ -279,9 +284,9 @@ var view = Marionette.ItemView.extend({
|
||||
options.ignoreEpisodesWithoutFiles = true;
|
||||
}
|
||||
|
||||
else if (monitor === 'none') {
|
||||
/*else if (monitor === 'none') {
|
||||
this.model.setSeasonPass(lastSeason.seasonNumber + 1);
|
||||
}
|
||||
}*/
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
@@ -73,11 +73,11 @@
|
||||
<!--Uncomment if we need to add even more controls to add series-->
|
||||
<!--<label style="visibility: hidden">Add</label>-->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-success add x-add" title="Add">
|
||||
<button class="btn btn-success add x-add" title="Add" data-artist="{{artistName}}">
|
||||
<i class="icon-sonarr-add"></i>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-success add x-add-search" title="Add and Search for missing tracks">
|
||||
<button class="btn btn-success add x-add-search" title="Add and Search for missing tracks" data-artist="{{artistName}}">
|
||||
<i class="icon-sonarr-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -116,11 +116,11 @@
|
||||
<!--Uncomment if we need to add even more controls to add series-->
|
||||
<!--<label style="visibility: hidden">Add</label>-->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-success add x-add" title="Add">
|
||||
<button class="btn btn-success add x-add-album" title="Add" data-album="{{albumName}}">
|
||||
<i class="icon-sonarr-add"></i>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-success add x-add-search" title="Add and Search for missing tracks">
|
||||
<button class="btn btn-success add x-add-album-search" title="Add and Search for missing tracks" data-album="{{albumName}}">
|
||||
<i class="icon-sonarr-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user