Default Wanted and Cutoff to be 50 movies per page, added filtering options to Cutoff and a Search all (#984)

This commit is contained in:
Devin Buhl 2017-03-02 17:28:29 -05:00 committed by GitHub
commit bdc0db3357
4 changed files with 137 additions and 67 deletions

View file

@ -11,7 +11,7 @@ var Collection = PagableCollection.extend({
tableName : 'wanted.cutoff', tableName : 'wanted.cutoff',
state : { state : {
pageSize : 15, pageSize : 50,
sortKey : 'title', sortKey : 'title',
order : -1 order : -1
}, },
@ -28,7 +28,7 @@ var Collection = PagableCollection.extend({
} }
}, },
// Filter Modes
filterModes : { filterModes : {
'monitored' : [ 'monitored' : [
'monitored', 'monitored',
@ -38,11 +38,28 @@ var Collection = PagableCollection.extend({
'monitored', 'monitored',
'false' 'false'
], ],
'announced' : [
'moviestatus',
'announced'
],
'incinemas' : [
'moviestatus',
'incinemas'
],
'released' : [
'moviestatus',
'released'
],
'available' : [
'moviestatus',
'available'
],
'all' : [
'all',
'all'
]
}, },
// sortMappings : {
// 'this' : { sortKey : 'this.sortTitle' }
// },
parseState : function(resp) { parseState : function(resp) {
return { totalRecords : resp.totalRecords }; return { totalRecords : resp.totalRecords };

View file

@ -97,7 +97,14 @@ module.exports = Marionette.Layout.extend({
callback : this._searchSelected, callback : this._searchSelected,
ownerContext : this, ownerContext : this,
className : 'x-search-selected' className : 'x-search-selected'
} },
{
title : 'Search All',
icon : 'icon-sonarr-search',
callback : this._searchMissing,
ownerContext : this,
className : 'x-search-missing'
},
] ]
}; };
@ -107,6 +114,20 @@ module.exports = Marionette.Layout.extend({
menuKey : 'wanted.filterMode', menuKey : 'wanted.filterMode',
defaultAction : 'monitored', defaultAction : 'monitored',
items : [ items : [
{
key : 'all',
title : '',
tooltip : 'All',
icon : 'icon-sonarr-all',
callback : this._setFilter
},
{
key : 'available',
title : '',
tooltip : 'Available & Monitored',
icon : 'icon-sonarr-available',
callback : this._setFilter
},
{ {
key : 'monitored', key : 'monitored',
title : '', title : '',
@ -120,6 +141,27 @@ module.exports = Marionette.Layout.extend({
tooltip : 'Unmonitored Only', tooltip : 'Unmonitored Only',
icon : 'icon-sonarr-unmonitored', icon : 'icon-sonarr-unmonitored',
callback : this._setFilter callback : this._setFilter
},
{
key : 'announced',
title : '',
tooltip : 'Announced Only',
icon : 'icon-sonarr-movie-announced',
callback : this._setFilter
},
{
key : 'incinemas',
title : '',
tooltip : 'In Cinemas Only',
icon : 'icon-sonarr-movie-cinemas',
callback : this._setFilter
},
{
key : 'released',
title : '',
tooltip : 'Released Only',
icon : 'icon-sonarr-movie-released',
callback : this._setFilter
} }
] ]
}; };
@ -171,5 +213,14 @@ module.exports = Marionette.Layout.extend({
name : 'moviesSearch', name : 'moviesSearch',
movieIds : ids movieIds : ids
}); });
},
_searchMissing : function() {
if (window.confirm('Are you sure you want to search for {0} filtered 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('missingMoviesSearch', { name : 'missingMoviesSearch',
filterKey : this.collection.state.filterKey,
filterValue : this.collection.state.filterValue });
} }
},
}); });

View file

@ -11,7 +11,7 @@ var Collection = PagableCollection.extend({
tableName : 'wanted.missing', tableName : 'wanted.missing',
state : { state : {
pageSize : 15, pageSize : 50,
sortKey : 'title', sortKey : 'title',
order : -1 order : -1
}, },

View file

@ -57,6 +57,7 @@ module.exports = Marionette.Layout.extend({
name : 'status', name : 'status',
label : 'Status', label : 'Status',
cell : MovieStatusWithTextCell, cell : MovieStatusWithTextCell,
sortable : false
}, },
], ],
@ -130,11 +131,12 @@ module.exports = Marionette.Layout.extend({
} }
] ]
}; };
var filterOptions = { var filterOptions = {
type : 'radio', type : 'radio',
storeState : false, storeState : false,
menuKey : 'wanted.filterMode', menuKey : 'wanted.filterMode',
defaultAction : 'available', defaultAction : 'monitored',
items : [ items : [
{ {
key : 'all', key : 'all',