mirror of https://github.com/Radarr/Radarr
Add back min availability to bulk movie edit
This commit is contained in:
parent
b32d168742
commit
976712d6d7
|
@ -1,7 +1,7 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import SelectInput from './SelectInput';
|
import EnhancedSelectInput from './EnhancedSelectInput';
|
||||||
|
|
||||||
const availabilityOptions = [
|
const availabilityOptions = [
|
||||||
{ key: 'announced', value: translate('Announced') },
|
{ key: 'announced', value: translate('Announced') },
|
||||||
|
@ -34,7 +34,7 @@ function AvailabilitySelectInput(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectInput
|
<EnhancedSelectInput
|
||||||
{...props}
|
{...props}
|
||||||
values={values}
|
values={values}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import styles from './EditMoviesModalContent.css';
|
||||||
interface SavePayload {
|
interface SavePayload {
|
||||||
monitored?: boolean;
|
monitored?: boolean;
|
||||||
qualityProfileId?: number;
|
qualityProfileId?: number;
|
||||||
|
minimumAvailability?: string;
|
||||||
rootFolderPath?: string;
|
rootFolderPath?: string;
|
||||||
moveFiles?: boolean;
|
moveFiles?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +41,7 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
|
||||||
const [qualityProfileId, setQualityProfileId] = useState<string | number>(
|
const [qualityProfileId, setQualityProfileId] = useState<string | number>(
|
||||||
NO_CHANGE
|
NO_CHANGE
|
||||||
);
|
);
|
||||||
|
const [minimumAvailability, setMinimumAvailability] = useState(NO_CHANGE);
|
||||||
const [rootFolderPath, setRootFolderPath] = useState(NO_CHANGE);
|
const [rootFolderPath, setRootFolderPath] = useState(NO_CHANGE);
|
||||||
const [isConfirmMoveModalOpen, setIsConfirmMoveModalOpen] = useState(false);
|
const [isConfirmMoveModalOpen, setIsConfirmMoveModalOpen] = useState(false);
|
||||||
|
|
||||||
|
@ -58,6 +60,11 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
|
||||||
payload.qualityProfileId = qualityProfileId as number;
|
payload.qualityProfileId = qualityProfileId as number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (minimumAvailability !== NO_CHANGE) {
|
||||||
|
hasChanges = true;
|
||||||
|
payload.minimumAvailability = minimumAvailability as string;
|
||||||
|
}
|
||||||
|
|
||||||
if (rootFolderPath !== NO_CHANGE) {
|
if (rootFolderPath !== NO_CHANGE) {
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
payload.rootFolderPath = rootFolderPath;
|
payload.rootFolderPath = rootFolderPath;
|
||||||
|
@ -70,7 +77,14 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
|
||||||
|
|
||||||
onModalClose();
|
onModalClose();
|
||||||
},
|
},
|
||||||
[monitored, qualityProfileId, rootFolderPath, onSavePress, onModalClose]
|
[
|
||||||
|
monitored,
|
||||||
|
qualityProfileId,
|
||||||
|
minimumAvailability,
|
||||||
|
rootFolderPath,
|
||||||
|
onSavePress,
|
||||||
|
onModalClose,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
const onInputChange = useCallback(
|
const onInputChange = useCallback(
|
||||||
|
@ -82,6 +96,9 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
|
||||||
case 'qualityProfileId':
|
case 'qualityProfileId':
|
||||||
setQualityProfileId(value);
|
setQualityProfileId(value);
|
||||||
break;
|
break;
|
||||||
|
case 'minimumAvailability':
|
||||||
|
setMinimumAvailability(value);
|
||||||
|
break;
|
||||||
case 'rootFolderPath':
|
case 'rootFolderPath':
|
||||||
setRootFolderPath(value);
|
setRootFolderPath(value);
|
||||||
break;
|
break;
|
||||||
|
@ -146,6 +163,19 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
<FormGroup>
|
||||||
|
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.AVAILABILITY_SELECT}
|
||||||
|
name="minimumAvailability"
|
||||||
|
value={minimumAvailability}
|
||||||
|
includeNoChange={true}
|
||||||
|
includeNoChangeDisabled={false}
|
||||||
|
onChange={onInputChange}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormLabel>{translate('RootFolder')}</FormLabel>
|
<FormLabel>{translate('RootFolder')}</FormLabel>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue