New: Search library by MusicBrainz ID

(cherry picked from commit 377e5f7fc7bb070a2f6e55a6bc8f2bdad733c308)

Closes #3813
This commit is contained in:
Bogdan 2023-06-21 05:29:15 +03:00
parent 4ee3d581dd
commit 82cb0f1889
3 changed files with 12 additions and 0 deletions

View file

@ -25,6 +25,7 @@ function createCleanArtistSelector() {
sortName, sortName,
foreignArtistId, foreignArtistId,
images, images,
firstCharacter: artistName.charAt(0).toLowerCase(),
tags: tags.reduce((acc, id) => { tags: tags.reduce((acc, id) => {
const matchingTag = allTags.find((tag) => tag.id === id); const matchingTag = allTags.find((tag) => tag.id === id);

View file

@ -10,6 +10,7 @@ function ArtistSearchResult(props) {
match, match,
artistName, artistName,
images, images,
foreignArtistId,
tags tags
} = props; } = props;
@ -34,6 +35,14 @@ function ArtistSearchResult(props) {
{artistName} {artistName}
</div> </div>
{
match.key === 'foreignArtistId' && foreignArtistId ?
<div className={styles.alternateTitle}>
MbId: {foreignArtistId}
</div> :
null
}
{ {
tag ? tag ?
<div className={styles.tagContainer}> <div className={styles.tagContainer}>
@ -54,6 +63,7 @@ function ArtistSearchResult(props) {
ArtistSearchResult.propTypes = { ArtistSearchResult.propTypes = {
artistName: PropTypes.string.isRequired, artistName: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired,
foreignArtistId: PropTypes.string.isRequired,
tags: PropTypes.arrayOf(PropTypes.object).isRequired, tags: PropTypes.arrayOf(PropTypes.object).isRequired,
match: PropTypes.object.isRequired match: PropTypes.object.isRequired
}; };

View file

@ -9,6 +9,7 @@ const fuseOptions = {
minMatchCharLength: 1, minMatchCharLength: 1,
keys: [ keys: [
'artistName', 'artistName',
'foreignArtistId',
'tags.label' 'tags.label'
] ]
}; };