mental32 / spotify.py

🌐 API wrapper for Spotify 🎶
https://spotifypy.readthedocs.io/en/latest/
MIT License
150 stars 38 forks source link

Feature Idea - Pass limit=None to get all playlists, tracks, ... #22

Closed micahdlamb closed 4 years ago

micahdlamb commented 4 years ago

When I call user.get_playlists() and user.library.get_tracks() I need all the playlists/tracks but it currently limits me to getting 50 at a time.

It would be nice if I could pass limit=None to get them all at once. I'll make a pull request if you think its worth doing.

mental32 commented 4 years ago

Normally the way to do this would be a obj.get_all_{blank} method, but I've just noticed thanks to you that Userand Library do not implement these complimentary methods.

I'd like to add:

And perhaps obj.total_{blank} methods as seen on Artist.total_albums()

Perhaps a better design as you pointed out would be to allow passing None as the limit argument where then the Spotify paginated object will be exhausted. Of course if this will be the case then the /examples usages need to be updated.

@micahdlamb I can implement this now and get a pypi release up (would be version 0.7.0) or are you keen on PR'ing this yourself?

micahdlamb commented 4 years ago

I'd love if you do it :) Thanks so much!

micahdlamb commented 4 years ago

I think I prefer just keeping a separate get_all_tracks() function. Its clear how to get all tracks when you see the get_all_tracks function in the intelliense.

mental32 commented 4 years ago

Right, I'll go ahead and add the above mentioned methods, I'll ping you when they're in?

mental32 commented 4 years ago

These methods have been added in v0.7.0 which is merged into master