-
-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(shuffle+): update GraphQL handling #3229
Conversation
Use tracksV2 instead of tracks Use queryArtistOverview from Definitions object Use hard-coded queryArtistDiscographyAll definition
Much needed. Was waiting on a fix for this |
Extensions/shuffle+.js
Outdated
@@ -368,12 +368,12 @@ | |||
} | |||
|
|||
async function fetchArtistTracks(uri) { | |||
const { queryArtistDiscographyAll } = Spicetify.GraphQL.Definitions; | |||
const { queryArtistOverview } = Spicetify.GraphQL.Definitions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryArtistOverview
is not available in some of supported spotify versions. revert.
Extensions/shuffle+.js
Outdated
@@ -338,7 +338,7 @@ | |||
if (errors) throw errors[0].message; | |||
if (data.albumUnion.playability.playable === false) throw "Album is not playable"; | |||
|
|||
return data.albumUnion.tracks.items.filter(({ track }) => track.playability.playable).map(({ track }) => (includeMetadata ? track : track.uri)); | |||
return data.albumUnion.tracksV2.items.filter(({ track }) => track.playability.playable).map(({ track }) => (includeMetadata ? track : track.uri)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not available in all supported spotify versions.
return data.albumUnion.tracksV2.items.filter(({ track }) => track.playability.playable).map(({ track }) => (includeMetadata ? track : track.uri)); | |
return (data.albumUnion?.tracksV2 ?? data.albumUnion?.tracks).items.filter(({ track }) => track.playability.playable).map(({ track }) => (includeMetadata ? track : track.uri)); |
tracksV2
instead oftracks
(if supported) when fetching album tracksqueryArtistDiscographyAll
definition (due to Spotify v1.2.46; see this PR)