1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-22 15:53:23 +00:00

Add Monitor New Items to artists select edit

This commit is contained in:
Bogdan 2023-10-28 22:58:14 +03:00
parent 57206da77b
commit 093d6c3c26

View file

@ -14,6 +14,7 @@ import styles from './EditArtistModalContent.css';
interface SavePayload { interface SavePayload {
monitored?: boolean; monitored?: boolean;
monitorNewItems?: string;
qualityProfileId?: number; qualityProfileId?: number;
metadataProfileId?: number; metadataProfileId?: number;
rootFolderPath?: string; rootFolderPath?: string;
@ -54,6 +55,7 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
const { artistIds, onSavePress, onModalClose } = props; const { artistIds, onSavePress, onModalClose } = props;
const [monitored, setMonitored] = useState(NO_CHANGE); const [monitored, setMonitored] = useState(NO_CHANGE);
const [monitorNewItems, setMonitorNewItems] = useState(NO_CHANGE);
const [qualityProfileId, setQualityProfileId] = useState<string | number>( const [qualityProfileId, setQualityProfileId] = useState<string | number>(
NO_CHANGE NO_CHANGE
); );
@ -73,6 +75,11 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
payload.monitored = monitored === 'monitored'; payload.monitored = monitored === 'monitored';
} }
if (monitorNewItems !== NO_CHANGE) {
hasChanges = true;
payload.monitorNewItems = monitorNewItems;
}
if (qualityProfileId !== NO_CHANGE) { if (qualityProfileId !== NO_CHANGE) {
hasChanges = true; hasChanges = true;
payload.qualityProfileId = qualityProfileId as number; payload.qualityProfileId = qualityProfileId as number;
@ -97,6 +104,7 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
}, },
[ [
monitored, monitored,
monitorNewItems,
qualityProfileId, qualityProfileId,
metadataProfileId, metadataProfileId,
rootFolderPath, rootFolderPath,
@ -111,6 +119,9 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
case 'monitored': case 'monitored':
setMonitored(value); setMonitored(value);
break; break;
case 'monitorNewItems':
setMonitorNewItems(value);
break;
case 'qualityProfileId': case 'qualityProfileId':
setQualityProfileId(value); setQualityProfileId(value);
break; break;
@ -168,6 +179,20 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>{translate('MonitorNewItems')}</FormLabel>
<FormInputGroup
type={inputTypes.MONITOR_NEW_ITEMS_SELECT}
name="monitorNewItems"
value={monitorNewItems}
includeNoChange={true}
includeNoChangeDisabled={false}
onChange={onInputChange}
helpText={translate('MonitorNewItemsHelpText')}
/>
</FormGroup>
<FormGroup> <FormGroup>
<FormLabel>{translate('QualityProfile')}</FormLabel> <FormLabel>{translate('QualityProfile')}</FormLabel>