mental32 / spotify.py

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

Check if device is None before using str(device) as parameter #27

Closed M3NIX closed 4 years ago

M3NIX commented 4 years ago

Added a check because otherwise the requests had the query parameter "device_id=None" (e.g. https://api.spotify.com/v1/me/player/shuffle?state=True&device_id=None) which was creating a 404 on the spotify api. This happened because when only using str(device) it returns None as a string and that results in failing if checks later in the http.py

To test the changes: player.next() was not working before when no device were specified as a parameter. now it does.

M3NIX commented 4 years ago

i condensed it now into one smaller line

M3NIX commented 4 years ago

i tested calling these functions with and without device parameter and they are working