Skip to content
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 not parsing full Deezer playlists #182

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

freyacodes
Copy link
Contributor

@freyacodes freyacodes commented Apr 16, 2024

This allows lavasrc to process more than the first 25 tracks in a Deezer playlist.

This removes the API call to Deezer at /playlist/:id/tracks and uses the already fetched data from /playlist/:id instead. It appears that the former is paginated, returning 25 results, whereas the latter returns the full dataset without pagination.

Here is a playlist you can use for testing: https://www.deezer.com/en/playlist/11958416461?host=5617782001&deferredFl=1

The above playlist yielded 243/260 tracks in my testing with this patch.

@topi314
Copy link
Owner

topi314 commented Apr 16, 2024

the reason I opted for the /playlist/{id}/tracks endpoint was because the /playlist/{id} endpoint only returns partial tracks

we should instead implement the actual pagination for the /playlist/{id}/tracks endpoint

(it seems to only miss the isrc but it would be nice to have that)

@freyacodes
Copy link
Contributor Author

In that case this is a trade-off between not getting ISRC or doing an additional 12 requests (in this case). I suppose the latter is acceptable

@freyacodes
Copy link
Contributor Author

After messing around, I realise that we don't actually need to page through the list:

https://api.deezer.com/2.0/playlist/11958416461/tracks?limit=1000

So then I just need to revert this change and add the request parameter

@freyacodes freyacodes force-pushed the playlist-full-track-list branch from 45f1bb0 to 4db1f54 Compare April 16, 2024 13:35
@topi314
Copy link
Owner

topi314 commented Apr 16, 2024

lol, is 1000 the upper limit?
I can't find any docs on it, playlists could possibly have more songs than this right?

@freyacodes
Copy link
Contributor Author

1.000 is not the upper limit. For the code I chose 10.000 as an arbitrary number

@topi314
Copy link
Owner

topi314 commented Apr 17, 2024

that is rather interesting lol

@topi314 topi314 merged commit a7dfa29 into topi314:master Apr 17, 2024
@freyacodes freyacodes deleted the playlist-full-track-list branch April 18, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants