From d9ff8e0d4a25fb4ed0ad53d7d064cb4df66fdebb Mon Sep 17 00:00:00 2001
From: geogolem <55031547+geogolem@users.noreply.github.com>
Date: Thu, 12 Nov 2020 23:13:39 -0500
Subject: [PATCH] Fixed: Clarify Status Filter, Add ConsideredAvailable,
MinAvailability Filters (#4924)
---
.../Filter/Builder/FilterBuilderRow.js | 10 ++++++---
...inimumAvailabilityFilterBuilderRowValue.js | 20 +++++++++++++++++
.../MovieStatusFilterBuilderRowValue.js | 21 ------------------
.../ReleaseStatusFilterBuilderRowValue.js | 22 +++++++++++++++++++
.../Helpers/Props/filterBuilderValueTypes.js | 3 ++-
.../src/Store/Actions/discoverMovieActions.js | 16 ++++++++++++--
.../src/Store/Actions/movieIndexActions.js | 16 ++++++++++++--
src/NzbDrone.Core/Localization/Core/en.json | 2 ++
8 files changed, 81 insertions(+), 29 deletions(-)
create mode 100644 frontend/src/Components/Filter/Builder/MinimumAvailabilityFilterBuilderRowValue.js
delete mode 100644 frontend/src/Components/Filter/Builder/MovieStatusFilterBuilderRowValue.js
create mode 100644 frontend/src/Components/Filter/Builder/ReleaseStatusFilterBuilderRowValue.js
diff --git a/frontend/src/Components/Filter/Builder/FilterBuilderRow.js b/frontend/src/Components/Filter/Builder/FilterBuilderRow.js
index b0ea07c6f..32063984d 100644
--- a/frontend/src/Components/Filter/Builder/FilterBuilderRow.js
+++ b/frontend/src/Components/Filter/Builder/FilterBuilderRow.js
@@ -8,10 +8,11 @@ import DateFilterBuilderRowValue from './DateFilterBuilderRowValue';
import FilterBuilderRowValueConnector from './FilterBuilderRowValueConnector';
import ImportListFilterBuilderRowValueConnector from './ImportListFilterBuilderRowValueConnector';
import IndexerFilterBuilderRowValueConnector from './IndexerFilterBuilderRowValueConnector';
-import MovieStatusFilterBuilderRowValue from './MovieStatusFilterBuilderRowValue';
+import MinimumAvailabilityFilterBuilderRowValue from './MinimumAvailabilityFilterBuilderRowValue';
import ProtocolFilterBuilderRowValue from './ProtocolFilterBuilderRowValue';
import QualityFilterBuilderRowValueConnector from './QualityFilterBuilderRowValueConnector';
import QualityProfileFilterBuilderRowValueConnector from './QualityProfileFilterBuilderRowValueConnector';
+import ReleaseStatusFilterBuilderRowValue from './ReleaseStatusFilterBuilderRowValue';
import TagFilterBuilderRowValueConnector from './TagFilterBuilderRowValueConnector';
import styles from './FilterBuilderRow.css';
@@ -69,8 +70,11 @@ function getRowValueConnector(selectedFilterBuilderProp) {
case filterBuilderValueTypes.QUALITY_PROFILE:
return QualityProfileFilterBuilderRowValueConnector;
- case filterBuilderValueTypes.MOVIE_STATUS:
- return MovieStatusFilterBuilderRowValue;
+ case filterBuilderValueTypes.RELEASE_STATUS:
+ return ReleaseStatusFilterBuilderRowValue;
+
+ case filterBuilderValueTypes.MINIMUM_AVAILABILITY:
+ return MinimumAvailabilityFilterBuilderRowValue;
case filterBuilderValueTypes.TAG:
return TagFilterBuilderRowValueConnector;
diff --git a/frontend/src/Components/Filter/Builder/MinimumAvailabilityFilterBuilderRowValue.js b/frontend/src/Components/Filter/Builder/MinimumAvailabilityFilterBuilderRowValue.js
new file mode 100644
index 000000000..0bf4b1d7e
--- /dev/null
+++ b/frontend/src/Components/Filter/Builder/MinimumAvailabilityFilterBuilderRowValue.js
@@ -0,0 +1,20 @@
+import React from 'react';
+import translate from 'Utilities/String/translate';
+import FilterBuilderRowValue from './FilterBuilderRowValue';
+
+const protocols = [
+ { id: 'announced', name: translate('Announced') },
+ { id: 'inCinemas', name: translate('InCinemas') },
+ { id: 'released', name: translate('Released') }
+];
+
+function MinimumAvailabilityFilterBuilderRowValue(props) {
+ return (
+
+ );
+}
+
+export default MinimumAvailabilityFilterBuilderRowValue;
diff --git a/frontend/src/Components/Filter/Builder/MovieStatusFilterBuilderRowValue.js b/frontend/src/Components/Filter/Builder/MovieStatusFilterBuilderRowValue.js
deleted file mode 100644
index d0ee81eeb..000000000
--- a/frontend/src/Components/Filter/Builder/MovieStatusFilterBuilderRowValue.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import FilterBuilderRowValue from './FilterBuilderRowValue';
-
-const protocols = [
- { id: 'tba', name: 'TBA' },
- { id: 'announced', name: 'Announced' },
- { id: 'inCinemas', name: 'In Cinemas' },
- { id: 'released', name: 'Released' },
- { id: 'deleted', name: 'Deleted' }
-];
-
-function MovieStatusFilterBuilderRowValue(props) {
- return (
-
- );
-}
-
-export default MovieStatusFilterBuilderRowValue;
diff --git a/frontend/src/Components/Filter/Builder/ReleaseStatusFilterBuilderRowValue.js b/frontend/src/Components/Filter/Builder/ReleaseStatusFilterBuilderRowValue.js
new file mode 100644
index 000000000..f1bebfe6a
--- /dev/null
+++ b/frontend/src/Components/Filter/Builder/ReleaseStatusFilterBuilderRowValue.js
@@ -0,0 +1,22 @@
+import React from 'react';
+import translate from 'Utilities/String/translate';
+import FilterBuilderRowValue from './FilterBuilderRowValue';
+
+const protocols = [
+ { id: 'tba', name: 'TBA' },
+ { id: 'announced', name: translate('Announced') },
+ { id: 'inCinemas', name: translate('InCinemas') },
+ { id: 'released', name: translate('Released') },
+ { id: 'deleted', name: translate('Deleted') }
+];
+
+function ReleaseStatusFilterBuilderRowValue(props) {
+ return (
+
+ );
+}
+
+export default ReleaseStatusFilterBuilderRowValue;
diff --git a/frontend/src/Helpers/Props/filterBuilderValueTypes.js b/frontend/src/Helpers/Props/filterBuilderValueTypes.js
index db340d046..9a89918d1 100644
--- a/frontend/src/Helpers/Props/filterBuilderValueTypes.js
+++ b/frontend/src/Helpers/Props/filterBuilderValueTypes.js
@@ -6,6 +6,7 @@ export const INDEXER = 'indexer';
export const PROTOCOL = 'protocol';
export const QUALITY = 'quality';
export const QUALITY_PROFILE = 'qualityProfile';
-export const MOVIE_STATUS = 'movieStatus';
+export const RELEASE_STATUS = 'releaseStatus';
+export const MINIMUM_AVAILABILITY = 'minimumAvailability';
export const TAG = 'tag';
export const IMPORTLIST = 'importList';
diff --git a/frontend/src/Store/Actions/discoverMovieActions.js b/frontend/src/Store/Actions/discoverMovieActions.js
index 524f1a486..ab4529351 100644
--- a/frontend/src/Store/Actions/discoverMovieActions.js
+++ b/frontend/src/Store/Actions/discoverMovieActions.js
@@ -235,9 +235,9 @@ export const defaultState = {
filterBuilderProps: [
{
name: 'status',
- label: 'Status',
+ label: translate('ReleaseStatus'),
type: filterBuilderTypes.EXACT,
- valueType: filterBuilderValueTypes.MOVIE_STATUS
+ valueType: filterBuilderValueTypes.RELEASE_STATUS
},
{
name: 'studio',
@@ -317,6 +317,18 @@ export const defaultState = {
return tagList.sort(sortByName);
}
},
+ {
+ name: 'isAvailable',
+ label: translate('ConsideredAvailable'),
+ type: filterBuilderTypes.EXACT,
+ valueType: filterBuilderValueTypes.BOOL
+ },
+ {
+ name: 'minimumAvailability',
+ label: translate('MinimumAvailability'),
+ type: filterBuilderTypes.EXACT,
+ valueType: filterBuilderValueTypes.MINIMUM_AVAILABILITY
+ },
{
name: 'ratings',
label: 'Rating',
diff --git a/frontend/src/Store/Actions/movieIndexActions.js b/frontend/src/Store/Actions/movieIndexActions.js
index d42e14afb..b723723a9 100644
--- a/frontend/src/Store/Actions/movieIndexActions.js
+++ b/frontend/src/Store/Actions/movieIndexActions.js
@@ -223,6 +223,18 @@ export const defaultState = {
type: filterBuilderTypes.EXACT,
valueType: filterBuilderValueTypes.BOOL
},
+ {
+ name: 'isAvailable',
+ label: translate('ConsideredAvailable'),
+ type: filterBuilderTypes.EXACT,
+ valueType: filterBuilderValueTypes.BOOL
+ },
+ {
+ name: 'minimumAvailability',
+ label: translate('MinimumAvailability'),
+ type: filterBuilderTypes.EXACT,
+ valueType: filterBuilderValueTypes.MINIMUM_AVAILABILITY
+ },
{
name: 'title',
label: translate('Title'),
@@ -230,9 +242,9 @@ export const defaultState = {
},
{
name: 'status',
- label: translate('Status'),
+ label: translate('ReleaseStatus'),
type: filterBuilderTypes.EXACT,
- valueType: filterBuilderValueTypes.MOVIE_STATUS
+ valueType: filterBuilderValueTypes.RELEASE_STATUS
},
{
name: 'studio',
diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json
index cc8cee482..8d6865dd9 100644
--- a/src/NzbDrone.Core/Localization/Core/en.json
+++ b/src/NzbDrone.Core/Localization/Core/en.json
@@ -32,6 +32,7 @@
"AnalyseVideoFiles": "Analyse video files",
"Analytics": "Analytics",
"AnalyticsEnabledHelpText": "Send anonymous usage and error information to Radarr's servers. This includes information on your browser, which Radarr WebUI pages you use, error reporting as well as OS and runtime version. We will use this information to prioritize features and bug fixes.",
+ "Announced": "Announced",
"ApiKey": "API Key",
"AppDataDirectory": "AppData directory",
"AppDataLocationHealthCheckMessage": "Updating will not be possible to prevent deleting AppData on Update",
@@ -350,6 +351,7 @@
"InteractiveImport": "Interactive Import",
"InteractiveSearch": "Interactive Search",
"Interval": "Interval",
+ "ConsideredAvailable": "Considered Available",
"KeyboardShortcuts": "Keyboard Shortcuts",
"Language": "Language",
"LanguageHelpText": "Language for Releases",