artist clicking fallback to primary artist if multiple artists

This commit is contained in:
Core 2022-09-11 00:48:56 +01:00
parent 6a4346028e
commit 23a889e11a
No known key found for this signature in database
GPG key ID: 2AB8327FBA02D1C0
2 changed files with 13 additions and 4 deletions

View file

@ -4535,8 +4535,13 @@ const app = new Vue({
{
icon: "./assets/feather/user.svg",
name: app.getLz("action.goToArtist"),
action: function () {
app.appRoute(`artist/${app.mk.nowPlayingItem.relationships.artists.data[0].id}`);
action: async function () {
if (app.mk.nowPlayingItem.relationships.artists.data[0].id) {
app.appRoute(`artist/${app.mk.nowPlayingItem.relationships.artists.data[0].id}`);
} else {
const id = await MusicKitInterop.fetchPrimaryArtist("id")
app.appRoute(`artist/${id}`);
}
},
},
{