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 7 years ago committed by GitHub
parent f3b3c9ff6a
commit bdc0db3357

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

@ -97,7 +97,14 @@ module.exports = Marionette.Layout.extend({
callback : this._searchSelected,
ownerContext : this,
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',
defaultAction : 'monitored',
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',
title : '',
@ -120,8 +141,29 @@ module.exports = Marionette.Layout.extend({
tooltip : 'Unmonitored Only',
icon : 'icon-sonarr-unmonitored',
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({
@ -171,5 +213,14 @@ module.exports = Marionette.Layout.extend({
name : 'moviesSearch',
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',
state : {
pageSize : 15,
pageSize : 50,
sortKey : 'title',
order : -1
},
@ -37,26 +37,26 @@ var Collection = PagableCollection.extend({
'monitored',
'false'
],
'announced' : [
'moviestatus',
'announced'
],
'incinemas' : [
'moviestatus',
'incinemas'
],
'released' : [
'moviestatus',
'released'
],
'available' : [
'moviestatus',
'available'
],
'all' : [
'all',
'all'
]
'announced' : [
'moviestatus',
'announced'
],
'incinemas' : [
'moviestatus',
'incinemas'
],
'released' : [
'moviestatus',
'released'
],
'available' : [
'moviestatus',
'available'
],
'all' : [
'all',
'all'
]
},
parseState : function(resp) {

@ -57,6 +57,7 @@ module.exports = Marionette.Layout.extend({
name : 'status',
label : 'Status',
cell : MovieStatusWithTextCell,
sortable : false
},
],
@ -130,26 +131,27 @@ module.exports = Marionette.Layout.extend({
}
]
};
var filterOptions = {
type : 'radio',
storeState : false,
menuKey : 'wanted.filterMode',
defaultAction : 'available',
defaultAction : 'monitored',
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 : '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',
title : '',
@ -164,29 +166,29 @@ module.exports = Marionette.Layout.extend({
icon : 'icon-sonarr-unmonitored',
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
}
]
};
{
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({
left : [leftSideButtons],
right : [filterOptions],

Loading…
Cancel
Save