From 0361299a73ac1e24813e274ac69161a937b452b8 Mon Sep 17 00:00:00 2001 From: ManiMatter <124743318+ManiMatter@users.noreply.github.com> Date: Sun, 8 Sep 2024 19:56:11 +0200 Subject: [PATCH] New: Last Searched column on Wanted screens (#10392) * Adding lastSearchTime to API and "Last Searched" to Frontend (cutoff unmet & missing) Picking lastSearchTime from movie instead of movieMetaData --------- Co-authored-by: Bogdan --- frontend/src/Movie/Movie.ts | 1 + frontend/src/Store/Actions/wantedActions.js | 12 ++++++++++++ .../src/Wanted/CutoffUnmet/CutoffUnmetConnector.js | 6 ++++-- frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js | 12 ++++++++++++ frontend/src/Wanted/Missing/MissingConnector.js | 6 ++++-- frontend/src/Wanted/Missing/MissingRow.js | 12 ++++++++++++ src/NzbDrone.Core/Localization/Core/en.json | 1 + src/Radarr.Api.V3/Movies/MovieResource.cs | 4 +++- 8 files changed, 49 insertions(+), 5 deletions(-) diff --git a/frontend/src/Movie/Movie.ts b/frontend/src/Movie/Movie.ts index 69cc76c0b..ff98cc10a 100644 --- a/frontend/src/Movie/Movie.ts +++ b/frontend/src/Movie/Movie.ts @@ -72,6 +72,7 @@ interface Movie extends ModelBase { images: Image[]; movieFile: MovieFile; hasFile: boolean; + lastSearchTime?: string; isAvailable: boolean; isSaving?: boolean; } diff --git a/frontend/src/Store/Actions/wantedActions.js b/frontend/src/Store/Actions/wantedActions.js index e10d90de6..7a2165628 100644 --- a/frontend/src/Store/Actions/wantedActions.js +++ b/frontend/src/Store/Actions/wantedActions.js @@ -58,6 +58,12 @@ export const defaultState = { isSortable: true, isVisible: false }, + { + name: 'movies.lastSearchTime', + label: () => translate('LastSearched'), + isSortable: true, + isVisible: false + }, { name: 'status', label: () => translate('Status'), @@ -143,6 +149,12 @@ export const defaultState = { label: () => translate('Languages'), isVisible: false }, + { + name: 'movies.lastSearchTime', + label: () => translate('LastSearched'), + isSortable: true, + isVisible: false + }, { name: 'status', label: () => translate('Status'), diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js index 2c1377807..ef3af7bf1 100644 --- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js +++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js @@ -126,14 +126,16 @@ class CutoffUnmetConnector extends Component { onSearchSelectedPress = (selected) => { this.props.executeCommand({ name: commandNames.MOVIE_SEARCH, - movieIds: selected + movieIds: selected, + commandFinished: this.repopulate }); }; onSearchAllCutoffUnmetPress = (monitored) => { this.props.executeCommand({ name: commandNames.CUTOFF_UNMET_MOVIES_SEARCH, - monitored + monitored, + commandFinished: this.repopulate }); }; diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js index 88b6644de..d0b8ff8ea 100644 --- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js +++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetRow.js @@ -21,6 +21,7 @@ function CutoffUnmetRow(props) { inCinemas, digitalRelease, physicalRelease, + lastSearchTime, isSelected, columns, onSelectedChange @@ -110,6 +111,16 @@ function CutoffUnmetRow(props) { ); } + if (name === 'movies.lastSearchTime') { + return ( + + ); + } + if (name === 'status') { return ( { this.props.executeCommand({ name: commandNames.MOVIE_SEARCH, - movieIds: selected + movieIds: selected, + commandFinished: this.repopulate }); }; onSearchAllMissingPress = (monitored) => { this.props.executeCommand({ name: commandNames.MISSING_MOVIES_SEARCH, - monitored + monitored, + commandFinished: this.repopulate }); }; diff --git a/frontend/src/Wanted/Missing/MissingRow.js b/frontend/src/Wanted/Missing/MissingRow.js index 8fc057628..a6467e5f1 100644 --- a/frontend/src/Wanted/Missing/MissingRow.js +++ b/frontend/src/Wanted/Missing/MissingRow.js @@ -20,6 +20,7 @@ function MissingRow(props) { inCinemas, digitalRelease, physicalRelease, + lastSearchTime, isSelected, columns, onSelectedChange @@ -100,6 +101,16 @@ function MissingRow(props) { ); } + if (name === 'movies.lastSearchTime') { + return ( + + ); + } + if (name === 'status') { return (