Add back min availability to bulk movie edit

pull/8511/head v4.5.1.7282
Qstick 2 years ago
parent b32d168742
commit 976712d6d7

@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import translate from 'Utilities/String/translate';
import SelectInput from './SelectInput';
import EnhancedSelectInput from './EnhancedSelectInput';
const availabilityOptions = [
{ key: 'announced', value: translate('Announced') },
@ -34,7 +34,7 @@ function AvailabilitySelectInput(props) {
}
return (
<SelectInput
<EnhancedSelectInput
{...props}
values={values}
/>

@ -15,6 +15,7 @@ import styles from './EditMoviesModalContent.css';
interface SavePayload {
monitored?: boolean;
qualityProfileId?: number;
minimumAvailability?: string;
rootFolderPath?: string;
moveFiles?: boolean;
}
@ -40,6 +41,7 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
const [qualityProfileId, setQualityProfileId] = useState<string | number>(
NO_CHANGE
);
const [minimumAvailability, setMinimumAvailability] = useState(NO_CHANGE);
const [rootFolderPath, setRootFolderPath] = useState(NO_CHANGE);
const [isConfirmMoveModalOpen, setIsConfirmMoveModalOpen] = useState(false);
@ -58,6 +60,11 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
payload.qualityProfileId = qualityProfileId as number;
}
if (minimumAvailability !== NO_CHANGE) {
hasChanges = true;
payload.minimumAvailability = minimumAvailability as string;
}
if (rootFolderPath !== NO_CHANGE) {
hasChanges = true;
payload.rootFolderPath = rootFolderPath;
@ -70,7 +77,14 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
onModalClose();
},
[monitored, qualityProfileId, rootFolderPath, onSavePress, onModalClose]
[
monitored,
qualityProfileId,
minimumAvailability,
rootFolderPath,
onSavePress,
onModalClose,
]
);
const onInputChange = useCallback(
@ -82,6 +96,9 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
case 'qualityProfileId':
setQualityProfileId(value);
break;
case 'minimumAvailability':
setMinimumAvailability(value);
break;
case 'rootFolderPath':
setRootFolderPath(value);
break;
@ -134,7 +151,7 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
</FormGroup>
<FormGroup>
<FormLabel>{translate('Quality Profile')}</FormLabel>
<FormLabel>{translate('QualityProfile')}</FormLabel>
<FormInputGroup
type={inputTypes.QUALITY_PROFILE_SELECT}
@ -147,7 +164,20 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
</FormGroup>
<FormGroup>
<FormLabel>{translate('Root Folder')}</FormLabel>
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
<FormInputGroup
type={inputTypes.AVAILABILITY_SELECT}
name="minimumAvailability"
value={minimumAvailability}
includeNoChange={true}
includeNoChangeDisabled={false}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('RootFolder')}</FormLabel>
<FormInputGroup
type={inputTypes.ROOT_FOLDER_SELECT}

Loading…
Cancel
Save