From ec5161e848b7946b1ce27567f6051a7d017f8806 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Sun, 22 Jan 2017 04:58:04 -0500 Subject: [PATCH] Add more filter options to movie list --- src/UI/Movies/Index/MoviesIndexLayout.js | 21 +++++++++++++++++++++ src/UI/Movies/MoviesCollection.js | 15 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/UI/Movies/Index/MoviesIndexLayout.js b/src/UI/Movies/Index/MoviesIndexLayout.js index 87a2de772..479c6df12 100644 --- a/src/UI/Movies/Index/MoviesIndexLayout.js +++ b/src/UI/Movies/Index/MoviesIndexLayout.js @@ -182,6 +182,27 @@ module.exports = Marionette.Layout.extend({ tooltip : 'Missing Only', icon : 'icon-sonarr-missing', callback : this._setFilter + }, + { + key : 'released', + title : '', + tooltip : 'Released', + icon : 'icon-sonarr-movie-released', + callback : this._setFilter + }, + { + key : 'announced', + title : '', + tooltip : 'Announced', + icon : 'icon-sonarr-movie-announced', + callback : this._setFilter + }, + { + key : 'cinemas', + title : '', + tooltip : 'In Cinemas', + icon : 'icon-sonarr-movie-cinemas', + callback : this._setFilter } ] }; diff --git a/src/UI/Movies/MoviesCollection.js b/src/UI/Movies/MoviesCollection.js index 193f47ef6..f2c53d80d 100644 --- a/src/UI/Movies/MoviesCollection.js +++ b/src/UI/Movies/MoviesCollection.js @@ -67,6 +67,21 @@ var Collection = PageableCollection.extend({ 'missing' : [ 'downloaded', false + ], + 'released' : [ + null, + null, + function(model) { return model.getStatus() == "released"; } + ], + 'announced' : [ + null, + null, + function(model) { return model.getStatus() == "announced"; } + ], + 'cinemas' : [ + null, + null, + function(model) { return model.getStatus() == "inCinemas"; } ] },