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

pull/2/head
Devin Buhl 8 years ago committed by GitHub
parent f3b3c9ff6a
commit bdc0db3357

@ -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 };

@ -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,8 +141,29 @@ 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
} }
] ]
}; };
this.toolbar.show(new ToolbarLayout({ this.toolbar.show(new ToolbarLayout({
@ -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 });
}
},
}); });

@ -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
}, },
@ -37,26 +37,26 @@ var Collection = PagableCollection.extend({
'monitored', 'monitored',
'false' 'false'
], ],
'announced' : [ 'announced' : [
'moviestatus', 'moviestatus',
'announced' 'announced'
], ],
'incinemas' : [ 'incinemas' : [
'moviestatus', 'moviestatus',
'incinemas' 'incinemas'
], ],
'released' : [ 'released' : [
'moviestatus', 'moviestatus',
'released' 'released'
], ],
'available' : [ 'available' : [
'moviestatus', 'moviestatus',
'available' 'available'
], ],
'all' : [ 'all' : [
'all', 'all',
'all' 'all'
] ]
}, },
parseState : function(resp) { parseState : function(resp) {

@ -57,6 +57,7 @@ module.exports = Marionette.Layout.extend({
name : 'status', name : 'status',
label : 'Status', label : 'Status',
cell : MovieStatusWithTextCell, cell : MovieStatusWithTextCell,
sortable : false
}, },
], ],
@ -130,26 +131,27 @@ 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',
title : '', title : '',
tooltip : 'All', tooltip : 'All',
icon : 'icon-sonarr-all', icon : 'icon-sonarr-all',
callback : this._setFilter callback : this._setFilter
}, },
{ {
key : 'available', key : 'available',
title : '', title : '',
tooltip : 'Available & Monitored', tooltip : 'Available & Monitored',
icon : 'icon-sonarr-available', icon : 'icon-sonarr-available',
callback : this._setFilter callback : this._setFilter
}, },
{ {
key : 'monitored', key : 'monitored',
title : '', title : '',
@ -164,29 +166,29 @@ module.exports = Marionette.Layout.extend({
icon : 'icon-sonarr-unmonitored', icon : 'icon-sonarr-unmonitored',
callback : this._setFilter callback : this._setFilter
}, },
{ {
key : 'announced', key : 'announced',
title : '', title : '',
tooltip : 'Announced Only', tooltip : 'Announced Only',
icon : 'icon-sonarr-movie-announced', icon : 'icon-sonarr-movie-announced',
callback : this._setFilter callback : this._setFilter
}, },
{ {
key : 'incinemas', key : 'incinemas',
title : '', title : '',
tooltip : 'In Cinemas Only', tooltip : 'In Cinemas Only',
icon : 'icon-sonarr-movie-cinemas', icon : 'icon-sonarr-movie-cinemas',
callback : this._setFilter callback : this._setFilter
}, },
{ {
key : 'released', key : 'released',
title : '', title : '',
tooltip : 'Released Only', tooltip : 'Released Only',
icon : 'icon-sonarr-movie-released', icon : 'icon-sonarr-movie-released',
callback : this._setFilter callback : this._setFilter
} }
] ]
}; };
this.toolbar.show(new ToolbarLayout({ this.toolbar.show(new ToolbarLayout({
left : [leftSideButtons], left : [leftSideButtons],
right : [filterOptions], right : [filterOptions],

Loading…
Cancel
Save