| 505 | }; |
| 506 | |
| 507 | const fetchArtist = async (uri) => { |
| 508 | const { queryArtistOverview } = Spicetify.GraphQL.Definitions; |
| 509 | const { data } = await Spicetify.GraphQL.Request(queryArtistOverview, { |
| 510 | uri, |
| 511 | locale: Spicetify.Locale.getLocale(), |
| 512 | includePrerelease: false, |
| 513 | }); |
| 514 | const res = data.artistUnion; |
| 515 | return { |
| 516 | uri, |
| 517 | title: res.profile.name, |
| 518 | description: "Artist", |
| 519 | imageUrl: |
| 520 | res.visuals.avatarImage?.sources.reduce((prev, curr) => (prev.width > curr.width ? prev : curr)).url || |
| 521 | res.visuals.headerImage?.sources[0].url, |
| 522 | }; |
| 523 | }; |
| 524 | |
| 525 | const fetchTrack = async (uri, uid, context) => { |
| 526 | const base62 = uri.split(":")[2]; |