Skip to content

Commit

Permalink
New: (UI) Added Monitor New Albums to mass editor
Browse files Browse the repository at this point in the history
Fixes #3894
  • Loading branch information
mynameisbogdan committed Jul 22, 2023
1 parent 7b01c85 commit cc3667e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
13 changes: 13 additions & 0 deletions frontend/src/Artist/Editor/ArtistEditorRow.js
Expand Up @@ -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 {
Expand All @@ -21,6 +22,7 @@ class ArtistEditorRow extends Component {
artistName,
artistType,
monitored,
monitorNewItems,
metadataProfile,
qualityProfile,
path,
Expand All @@ -33,6 +35,8 @@ class ArtistEditorRow extends Component {
onSelectedChange
} = this.props;

const monitorNewItemsName = monitorNewItemsOptions.find((o) => o.key === monitorNewItems)?.value;

return (
<TableRow>
<TableSelectCell
Expand Down Expand Up @@ -78,6 +82,14 @@ class ArtistEditorRow extends Component {
);
}

if (name === 'monitorNewItems') {
return (
<TableRowCell key={name}>
{monitorNewItemsName ?? 'Unknown'}
</TableRowCell>
);
}

if (name === 'qualityProfileId') {
return (
<TableRowCell key={name}>
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/Store/Actions/artistEditorActions.js
Expand Up @@ -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'),
Expand Down
8 changes: 5 additions & 3 deletions 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;

0 comments on commit cc3667e

Please sign in to comment.