From cc3667ed13b902a49f01fc47cd27683aff85215d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 22 Jul 2023 03:04:11 +0300 Subject: [PATCH] New: (UI) Added `Monitor New Albums` to mass editor Fixes #3894 --- frontend/src/Artist/Editor/ArtistEditorRow.js | 13 +++++++++++++ frontend/src/Store/Actions/artistEditorActions.js | 6 ++++++ .../src/Utilities/Artist/monitorNewItemsOptions.js | 8 +++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/frontend/src/Artist/Editor/ArtistEditorRow.js b/frontend/src/Artist/Editor/ArtistEditorRow.js index c6febd819..56d72c34c 100644 --- a/frontend/src/Artist/Editor/ArtistEditorRow.js +++ b/frontend/src/Artist/Editor/ArtistEditorRow.js @@ -6,6 +6,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell'; import TableSelectCell from 'Components/Table/Cells/TableSelectCell'; import TableRow from 'Components/Table/TableRow'; import TagListConnector from 'Components/TagListConnector'; +import monitorNewItemsOptions from 'Utilities/Artist/monitorNewItemsOptions'; import formatBytes from 'Utilities/Number/formatBytes'; class ArtistEditorRow extends Component { @@ -21,6 +22,7 @@ class ArtistEditorRow extends Component { artistName, artistType, monitored, + monitorNewItems, metadataProfile, qualityProfile, path, @@ -33,6 +35,8 @@ class ArtistEditorRow extends Component { onSelectedChange } = this.props; + const monitorNewItemsName = monitorNewItemsOptions.find((o) => o.key === monitorNewItems)?.value; + return ( + {monitorNewItemsName ?? 'Unknown'} + + ); + } + if (name === 'qualityProfileId') { return ( @@ -135,6 +147,7 @@ ArtistEditorRow.propTypes = { artistName: PropTypes.string.isRequired, artistType: PropTypes.string, monitored: PropTypes.bool.isRequired, + monitorNewItems: PropTypes.string.isRequired, metadataProfile: PropTypes.object.isRequired, qualityProfile: PropTypes.object.isRequired, path: PropTypes.string.isRequired, diff --git a/frontend/src/Store/Actions/artistEditorActions.js b/frontend/src/Store/Actions/artistEditorActions.js index 1a595c296..fab600df1 100644 --- a/frontend/src/Store/Actions/artistEditorActions.js +++ b/frontend/src/Store/Actions/artistEditorActions.js @@ -46,6 +46,12 @@ export const defaultState = { isSortable: true, isVisible: true }, + { + name: 'monitorNewItems', + label: translate('MonitorNewItems'), + isSortable: true, + isVisible: true + }, { name: 'qualityProfileId', label: translate('QualityProfile'), diff --git a/frontend/src/Utilities/Artist/monitorNewItemsOptions.js b/frontend/src/Utilities/Artist/monitorNewItemsOptions.js index 32e86e41f..2cf4c2882 100644 --- a/frontend/src/Utilities/Artist/monitorNewItemsOptions.js +++ b/frontend/src/Utilities/Artist/monitorNewItemsOptions.js @@ -1,7 +1,9 @@ +import translate from 'Utilities/String/translate'; + const monitorNewItemsOptions = [ - { key: 'all', value: 'All Albums' }, - { key: 'none', value: 'None' }, - { key: 'new', value: 'New' } + { key: 'all', value: translate('AllAlbums') }, + { key: 'none', value: translate('None') }, + { key: 'new', value: translate('New') } ]; export default monitorNewItemsOptions;