fix(webapi): fall back to pathfinder GraphQL for playlists that 404 - #754
Open
prefixFelix wants to merge 2 commits into
Open
fix(webapi): fall back to pathfinder GraphQL for playlists that 404#754prefixFelix wants to merge 2 commits into
prefixFelix wants to merge 2 commits into
Conversation
12 tasks
Comment on lines
+1878
to
+1882
| // Only the metadata is wanted here, so ask for the smallest page of | ||
| // tracks pathfinder will give us. | ||
| if self.is_partner_playlist(id) { | ||
| return Ok(self.fetch_playlist(id, 0, 1)?.to_playlist()); | ||
| } |
Collaborator
There was a problem hiding this comment.
Is there a better way to know which playlist paths we should use to load. Otherwise we have to make this temp query in order to know if the playlist is a partner one or not?
Comment on lines
+1884
to
+1890
| match self.load(request) { | ||
| Err(Error::WebApiStatus(404)) => { | ||
| self.mark_partner_playlist(id); | ||
| Ok(self.fetch_playlist(id, 0, 1)?.to_playlist()) | ||
| } | ||
| result => result, | ||
| } |
Collaborator
There was a problem hiding this comment.
Having an error decide how to load is a little bit odd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated playlists like Daily Mix are no longer served via WebAPI, resulting in 404 errors.
Implemented a fallback that fetches playlists via api-partner (pathfinder GraphQL), if WebAPI requests returns 404.
So the WebAPI stays the primary source for loading playlists.
Playlists that 404 are remembered for the session. The detail page loads metadata and tracks separately, so without this both pay for the same 404 on every visit.