search selected button in wanted tab works

* switched MoviesSearchCommand to a list of id's

* adapted the MovieSearchService

* adapted UI files to use the new command
This commit is contained in:
Vlad Ilies
2017-01-21 23:43:58 +02:00
parent eb299ce847
commit 29ae088a3d
8 changed files with 54 additions and 21 deletions

View File

@@ -165,11 +165,11 @@ module.exports = Marionette.Layout.extend({
}));
CommandController.bindToCommand({
element : this.$('.x-search-selected'),
command : { name : 'episodeSearch' }
command : { name : 'moviesSearch' }
});
CommandController.bindToCommand({
element : this.$('.x-search-missing'),
command : { name : 'missingEpisodeSearch' }
command : { name : 'missingMoviesSearch' }
});
},
@@ -187,20 +187,20 @@ module.exports = Marionette.Layout.extend({
if (selected.length === 0) {
Messenger.show({
type : 'error',
message : 'No episodes selected'
message : 'No movies selected'
});
return;
}
var ids = _.pluck(selected, 'id');
CommandController.Execute('episodeSearch', {
name : 'episodeSearch',
episodeIds : ids
CommandController.Execute('moviesSearch', {
name : 'moviesSearch',
movieIds : ids
});
},
_searchMissing : function() {
if (window.confirm('Are you sure you want to search for {0} missing movies? '.format(this.collection.state.totalRecords) +
'One API request to each indexer will be used for each movie. ' + 'This cannot be stopped once started.')) {
CommandController.Execute('missingEpisodeSearch', { name : 'missingEpisodeSearch' });
CommandController.Execute('missingMoviesSearch', { name : 'missingMoviesSearch' });
}
},
_toggleMonitoredOfSelected : function() {
@@ -209,7 +209,7 @@ module.exports = Marionette.Layout.extend({
if (selected.length === 0) {
Messenger.show({
type : 'error',
message : 'No episodes selected'
message : 'No movies selected'
});
return;
}