- {artistInfo?.biography
+ {data?.info.biography
?.replace(/<[^>]*>/, '')
.replace('Read more on Last.fm', '')
?.trim()
- ? `${artistInfo?.biography
+ ? `${data?.info.biography
?.replace(/<[^>]*>/, '')
.replace('Read more on Last.fm', '')}`
: 'No artist biography found'}
@@ -426,35 +408,39 @@ const ArtistView = ({ ...rest }: any) => {
Related artists
- {artistInfo.similarArtist?.map((artist: any) => (
- {
- if (!rest.isModal) {
- history.push(`/library/artist/${artist.id}`);
- } else {
- dispatch(
- addModalPage({
- pageType: 'artist',
- id: artist.id,
- })
- );
- }
- }}
- >
- {artist.title}
-
- ))}
+ {data.info.similarArtist &&
+ data?.info.similarArtist.map((artist: Artist) => (
+ {
+ if (!rest.isModal) {
+ history.push(`/library/artist/${artist.id}`);
+ } else {
+ dispatch(
+ addModalPage({
+ pageType: 'artist',
+ id: artist.id,
+ })
+ );
+ }
+ }}
+ >
+ {artist.title}
+
+ ))}
- shell.openExternal(artistInfo?.lastFmUrl)}
- >
- View on Last.FM
-
+ {data.info.externalUrl &&
+ data.info.externalUrl.map((ext: GenericItem) => (
+ shell.openExternal(ext.id)}
+ >
+ {ext.title}
+
+ ))}
}
>
diff --git a/src/components/player/PlayerBar.tsx b/src/components/player/PlayerBar.tsx
index 668090d..c021756 100644
--- a/src/components/player/PlayerBar.tsx
+++ b/src/components/player/PlayerBar.tsx
@@ -439,8 +439,9 @@ const PlayerBar = () => {
enterable
placement="topStart"
text={
- playQueue[currentEntryList][playQueue.currentIndex]?.artist[0]?.title ||
- 'Unknown artist'
+ playQueue[currentEntryList][playQueue.currentIndex]?.artist
+ ? playQueue[currentEntryList][playQueue.currentIndex]?.artist[0]?.title
+ : 'Unknown artist'
}
>