| 436 | } |
| 437 | |
| 438 | async function fetchArtistTopTenTracks(uri) { |
| 439 | const { queryArtistOverview } = Spicetify.GraphQL.Definitions; |
| 440 | const { data, errors } = await Spicetify.GraphQL.Request(queryArtistOverview, { |
| 441 | uri, |
| 442 | locale: Spicetify.Locale.getLocale(), |
| 443 | includePrerelease: false, |
| 444 | }); |
| 445 | if (errors) throw errors[0].message; |
| 446 | return data.artistUnion.discography.topTracks.items.map(({ track }) => track.uri); |
| 447 | } |
| 448 | |
| 449 | async function fetchLikedTracks() { |
| 450 | const res = await Spicetify.CosmosAsync.get("sp://core-collection/unstable/@/list/tracks/all?responseFormat=protobufJson"); |