mirror of
https://github.com/Radarr/Radarr
synced 2025-12-06 08:28:50 +01:00
Fixed: Movie status on Wanted pages
(cherry picked from commit c9c8d4ad400f9e7066063236da180cf85ff63031)
This commit is contained in:
parent
955ee2f29b
commit
ef9836d71d
2 changed files with 52 additions and 0 deletions
|
|
@ -18,9 +18,19 @@ import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptions
|
||||||
import TablePager from 'Components/Table/TablePager';
|
import TablePager from 'Components/Table/TablePager';
|
||||||
import usePaging from 'Components/Table/usePaging';
|
import usePaging from 'Components/Table/usePaging';
|
||||||
import useCurrentPage from 'Helpers/Hooks/useCurrentPage';
|
import useCurrentPage from 'Helpers/Hooks/useCurrentPage';
|
||||||
|
import usePrevious from 'Helpers/Hooks/usePrevious';
|
||||||
import useSelectState from 'Helpers/Hooks/useSelectState';
|
import useSelectState from 'Helpers/Hooks/useSelectState';
|
||||||
import { align, icons, kinds } from 'Helpers/Props';
|
import { align, icons, kinds } from 'Helpers/Props';
|
||||||
|
import Movie from 'Movie/Movie';
|
||||||
import { executeCommand } from 'Store/Actions/commandActions';
|
import { executeCommand } from 'Store/Actions/commandActions';
|
||||||
|
import {
|
||||||
|
clearMovieFiles,
|
||||||
|
fetchMovieFiles,
|
||||||
|
} from 'Store/Actions/movieFileActions';
|
||||||
|
import {
|
||||||
|
clearQueueDetails,
|
||||||
|
fetchQueueDetails,
|
||||||
|
} from 'Store/Actions/queueActions';
|
||||||
import {
|
import {
|
||||||
batchToggleCutoffUnmetMovies,
|
batchToggleCutoffUnmetMovies,
|
||||||
clearCutoffUnmet,
|
clearCutoffUnmet,
|
||||||
|
|
@ -35,6 +45,8 @@ import { CheckInputChanged } from 'typings/inputs';
|
||||||
import { SelectStateInputProps } from 'typings/props';
|
import { SelectStateInputProps } from 'typings/props';
|
||||||
import { TableOptionsChangePayload } from 'typings/Table';
|
import { TableOptionsChangePayload } from 'typings/Table';
|
||||||
import getFilterValue from 'Utilities/Filter/getFilterValue';
|
import getFilterValue from 'Utilities/Filter/getFilterValue';
|
||||||
|
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
||||||
|
import selectUniqueIds from 'Utilities/Object/selectUniqueIds';
|
||||||
import {
|
import {
|
||||||
registerPagePopulator,
|
registerPagePopulator,
|
||||||
unregisterPagePopulator,
|
unregisterPagePopulator,
|
||||||
|
|
@ -108,6 +120,8 @@ function CutoffUnmet() {
|
||||||
const isSearchingForMovies =
|
const isSearchingForMovies =
|
||||||
isSearchingForAllMovies || isSearchingForSelectedMovies;
|
isSearchingForAllMovies || isSearchingForSelectedMovies;
|
||||||
|
|
||||||
|
const previousItems = usePrevious(items);
|
||||||
|
|
||||||
const handleSelectAllChange = useCallback(
|
const handleSelectAllChange = useCallback(
|
||||||
({ value }: CheckInputChanged) => {
|
({ value }: CheckInputChanged) => {
|
||||||
setSelectState({ type: value ? 'selectAll' : 'unselectAll', items });
|
setSelectState({ type: value ? 'selectAll' : 'unselectAll', items });
|
||||||
|
|
@ -204,6 +218,8 @@ function CutoffUnmet() {
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
dispatch(clearCutoffUnmet());
|
dispatch(clearCutoffUnmet());
|
||||||
|
dispatch(clearQueueDetails());
|
||||||
|
dispatch(clearMovieFiles());
|
||||||
};
|
};
|
||||||
}, [requestCurrentPage, dispatch]);
|
}, [requestCurrentPage, dispatch]);
|
||||||
|
|
||||||
|
|
@ -223,6 +239,21 @@ function CutoffUnmet() {
|
||||||
};
|
};
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!previousItems || hasDifferentItems(items, previousItems)) {
|
||||||
|
const movieIds = selectUniqueIds<Movie, number>(items, 'id');
|
||||||
|
const movieFileIds = selectUniqueIds<Movie, number>(items, 'movieFileId');
|
||||||
|
|
||||||
|
if (movieIds.length) {
|
||||||
|
dispatch(fetchQueueDetails({ movieIds }));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movieFileIds.length) {
|
||||||
|
dispatch(fetchMovieFiles({ movieFileIds }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [items, previousItems, dispatch]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent title={translate('CutoffUnmet')}>
|
<PageContent title={translate('CutoffUnmet')}>
|
||||||
<PageToolbar>
|
<PageToolbar>
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,16 @@ import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptions
|
||||||
import TablePager from 'Components/Table/TablePager';
|
import TablePager from 'Components/Table/TablePager';
|
||||||
import usePaging from 'Components/Table/usePaging';
|
import usePaging from 'Components/Table/usePaging';
|
||||||
import useCurrentPage from 'Helpers/Hooks/useCurrentPage';
|
import useCurrentPage from 'Helpers/Hooks/useCurrentPage';
|
||||||
|
import usePrevious from 'Helpers/Hooks/usePrevious';
|
||||||
import useSelectState from 'Helpers/Hooks/useSelectState';
|
import useSelectState from 'Helpers/Hooks/useSelectState';
|
||||||
import { align, icons, kinds } from 'Helpers/Props';
|
import { align, icons, kinds } from 'Helpers/Props';
|
||||||
import InteractiveImportModal from 'InteractiveImport/InteractiveImportModal';
|
import InteractiveImportModal from 'InteractiveImport/InteractiveImportModal';
|
||||||
|
import Movie from 'Movie/Movie';
|
||||||
import { executeCommand } from 'Store/Actions/commandActions';
|
import { executeCommand } from 'Store/Actions/commandActions';
|
||||||
|
import {
|
||||||
|
clearQueueDetails,
|
||||||
|
fetchQueueDetails,
|
||||||
|
} from 'Store/Actions/queueActions';
|
||||||
import {
|
import {
|
||||||
batchToggleMissingMovies,
|
batchToggleMissingMovies,
|
||||||
clearMissing,
|
clearMissing,
|
||||||
|
|
@ -36,6 +42,8 @@ import { CheckInputChanged } from 'typings/inputs';
|
||||||
import { SelectStateInputProps } from 'typings/props';
|
import { SelectStateInputProps } from 'typings/props';
|
||||||
import { TableOptionsChangePayload } from 'typings/Table';
|
import { TableOptionsChangePayload } from 'typings/Table';
|
||||||
import getFilterValue from 'Utilities/Filter/getFilterValue';
|
import getFilterValue from 'Utilities/Filter/getFilterValue';
|
||||||
|
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
||||||
|
import selectUniqueIds from 'Utilities/Object/selectUniqueIds';
|
||||||
import {
|
import {
|
||||||
registerPagePopulator,
|
registerPagePopulator,
|
||||||
unregisterPagePopulator,
|
unregisterPagePopulator,
|
||||||
|
|
@ -112,6 +120,8 @@ function Missing() {
|
||||||
const isSearchingForMovies =
|
const isSearchingForMovies =
|
||||||
isSearchingForAllMovies || isSearchingForSelectedMovies;
|
isSearchingForAllMovies || isSearchingForSelectedMovies;
|
||||||
|
|
||||||
|
const previousItems = usePrevious(items);
|
||||||
|
|
||||||
const handleSelectAllChange = useCallback(
|
const handleSelectAllChange = useCallback(
|
||||||
({ value }: CheckInputChanged) => {
|
({ value }: CheckInputChanged) => {
|
||||||
setSelectState({ type: value ? 'selectAll' : 'unselectAll', items });
|
setSelectState({ type: value ? 'selectAll' : 'unselectAll', items });
|
||||||
|
|
@ -216,6 +226,7 @@ function Missing() {
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
dispatch(clearMissing());
|
dispatch(clearMissing());
|
||||||
|
dispatch(clearQueueDetails());
|
||||||
};
|
};
|
||||||
}, [requestCurrentPage, dispatch]);
|
}, [requestCurrentPage, dispatch]);
|
||||||
|
|
||||||
|
|
@ -235,6 +246,16 @@ function Missing() {
|
||||||
};
|
};
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!previousItems || hasDifferentItems(items, previousItems)) {
|
||||||
|
const movieIds = selectUniqueIds<Movie, number>(items, 'id');
|
||||||
|
|
||||||
|
if (movieIds.length) {
|
||||||
|
dispatch(fetchQueueDetails({ movieIds }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [items, previousItems, dispatch]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent title={translate('Missing')}>
|
<PageContent title={translate('Missing')}>
|
||||||
<PageToolbar>
|
<PageToolbar>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue