dupontgu / retro-ipod-spotify-client

The software that powers the sPot: a 4th generation "Click Wheel" iPod with a full Spotify client.
Apache License 2.0
912 stars 90 forks source link

Search and Get_Playlist() Issues #63

Open hushdauihdhi opened 2 years ago

hushdauihdhi commented 2 years ago

Hey, I've been working on this project for a while now and am almost all the way through. I have only two major issues left on the software side and wanted to see if anyone could help me solve them. 1: When I try to use the search feature I get the following error and on the frontend the screen in just left with "loading..."

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.spotify.com/v1/search?q=&limit=5&offset=0&type=track

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 155, in spotify_manager.run_async(lambda: self.run_search(self.live_render.query)) File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 150, in run_search self.live_render.results = spotify_manager.search(query) File "/home/pi/retro-ipod-spotify-client/frontend/spotify_manager.py", line 418, in search track_results = sp.search(query, limit=5, type='track') File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 553, in search return self._get( File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 297, in _get return self._internal_call("GET", url, payload, kwargs) File "/home/pi/.local/lib/python3.9/site-packages/spotipy/client.py", line 267, in _internal_call raise SpotifyException( spotipy.exceptions.SpotifyException: http status: 400, code:-1 - https://api.spotify.com/v1/search?q=&limit=5&offset=0&type=track: No search query, reason: None

That was me searching just 'q'

2: I can never fetch any of my playlists I'm not sure what else to put here but the only lead I have are that, if I'm actively listening to a playlist while booting it up it will have it saved. I have no clue what is the problem here but it seems like there were a lot more steps that needed to be taken around the coding for the playlist function after looking at the comments next to them.

If anyone could help fill me in on anything I may be missing or doing wrong please let me know and thank you in advance!