add remixer to song artist (#1400)

This commit is contained in:
jeffvli
2026-01-03 03:03:10 -08:00
parent 261c5541cd
commit 186811156e
4 changed files with 147 additions and 57 deletions
@@ -96,24 +96,38 @@ export const JoinedArtists = ({
const hasArtistMatches = parts.some((part) => typeof part !== 'string');
// Find artists that were matched
const matchedArtistIds = new Set(nonOverlappingMatches.map((match) => match.artist.id));
// Find artists that are not present in the artist name
const unmatchedArtists = artists.filter(
(artist) => artist.name && !matchedArtistIds.has(artist.id),
);
// If no matches found and there are album artists, return the album artists
if (!hasArtistMatches && artists.length > 0) {
return (
<Text component="span" {...rootTextProps}>
{artists.map((artist, index) => (
<Fragment key={artist.id}>
<Fragment key={artist.id || `artist-${index}`}>
{index > 0 && ', '}
<Text
component={Link}
fw={600}
isLink
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
{...linkProps}
>
{artist.name}
</Text>
{artist.id ? (
<Text
component={Link}
fw={600}
isLink
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
{...linkProps}
>
{artist.name}
</Text>
) : (
<Text fw={600} {...linkProps}>
{artist.name}
</Text>
)}
</Fragment>
))}
</Text>
@@ -137,21 +151,56 @@ export const JoinedArtists = ({
}
const { artist, text } = part;
if (artist.id) {
return (
<Text
component={Link}
fw={600}
isLink
key={`${artist.id}-${index}`}
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
{...linkProps}
>
{text}
</Text>
);
}
return (
<Text
component={Link}
fw={600}
isLink
key={`${artist.id}-${index}`}
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
{...linkProps}
>
<Text fw={600} key={`${artist.name}-${index}`} {...linkProps}>
{text}
</Text>
);
})}
{unmatchedArtists.length > 0 && (
<>
{', '}
{unmatchedArtists.map((artist, index) => (
<Fragment key={artist.id}>
{index > 0 && ', '}
{artist.id ? (
<Text
component={Link}
fw={600}
isLink
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
{...linkProps}
>
{artist.name}
</Text>
) : (
<Text component="span" isMuted>
{artist.name}
</Text>
)}
</Fragment>
))}
</>
)}
</Text>
);
};