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

LB-1700: Get all tracks from spotify playlist #153

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

MonkeyDo
Copy link
Member

@MonkeyDo MonkeyDo commented Dec 4, 2024

As reported in https://tickets.metabrainz.org/browse/LB-1514, the ImportPlaylistPatch is limited to 100 tracks per playlist, even if there are more in that playlist.
This is because the spotipy playlist_items method (and the underlying spotify api endpoint) only allows fetching 100 tracks at a time.
To get all the tracks in a playlist, we need to call this endpoint repeatedly with an offset updated each loop.

The spotipy playlist_items method (and underlying spotify api endpoint) only allows fetching 100 tracks at a time.
To get all the tracks in a playlist, we need to call this endpoint repeatedly with an offset updated each loop
Copy link

github-actions bot commented Dec 4, 2024

Test Results

  4 files  ±0    4 suites  ±0   4s ⏱️ ±0s
 50 tests ±0   50 ✅ ±0  0 💤 ±0  0 ❌ ±0 
200 runs  ±0  200 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit b66a5e9. ± Comparison against base commit 5bb8bc1.

Copy link

github-actions bot commented Dec 4, 2024

Package Line Rate Complexity Health
. 32% 0
content_resolver 0% 0
content_resolver.formats 6% 0
content_resolver.model 0% 0
external 39% 0
listenbrainz 46% 0
musicbrainz 71% 0
patches 27% 0
patches.lb_radio_classes 0% 0
tools 20% 0
. 32% 0
content_resolver 0% 0
content_resolver.formats 6% 0
content_resolver.model 0% 0
external 39% 0
listenbrainz 45% 0
musicbrainz 69% 0
patches 27% 0
patches.lb_radio_classes 0% 0
tools 20% 0
. 32% 0
content_resolver 0% 0
content_resolver.formats 6% 0
content_resolver.model 0% 0
external 39% 0
listenbrainz 46% 0
musicbrainz 71% 0
patches 27% 0
patches.lb_radio_classes 0% 0
tools 20% 0
. 32% 0
content_resolver 0% 0
content_resolver.formats 6% 0
content_resolver.model 0% 0
external 39% 0
listenbrainz 46% 0
musicbrainz 71% 0
patches 27% 0
patches.lb_radio_classes 0% 0
tools 20% 0
Summary 21% (4174 / 20042) 0

MonkeyDo added a commit to metabrainz/listenbrainz-server that referenced this pull request Dec 4, 2024
@MonkeyDo MonkeyDo requested a review from mayhem December 4, 2024 16:00
@MonkeyDo
Copy link
Member Author

MonkeyDo commented Dec 4, 2024

Tested on test.LB and seems to have worked !
image

110 out of 169 songs, so something is not ideal, but certainly not limited to 100 tracks anymore

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mayhem mayhem merged commit 6293c49 into main Dec 4, 2024
6 checks passed
@mayhem mayhem deleted the spotify-playlist-tracks branch December 4, 2024 16:06
@MonkeyDo MonkeyDo changed the title Get all tracks from spotify playlist LB-1700: Get all tracks from spotify playlist Dec 4, 2024
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