tennitech / juke

Juke, an open-source music player, breathes new life into your music with a retro-inspired interface.
MIT License
2 stars 0 forks source link

Get Authorization from Spotify #21

Closed ImTrevorMartin closed 1 month ago

ImTrevorMartin commented 1 month ago

This is a conglomeration of issues #3 and #4. While some features aren't completely implemented yet (we don't have a login page, a clean way of displaying playlists, user management, etc), getting Spotify data out would be beneficial to both frontend (who will be able to use it for mock-ups) and backend (to prevent further blocking developers).

Currently, all data fetching is done in the Home component, which will show a "Login to Spotify" button if the session isn't defined (local storage is cleared) or if we previously had an error. It shows a rather ugly list of the user's playlists, but that should be enough for now.

Notes:

In summary: I got authentication working and I'm making this PR so we don't get further merge conflicts/so others can get work done.

Luxque commented 1 month ago

Sounds good! I will be doing the code review today, and let's what we can do.

ImTrevorMartin commented 1 month ago

We certainly could do this, even doing something that will dynamically fetch the playlists as we reach the end of the list, I didn't include this in this PR as we haven't yet fully merged with the frontend. I didn't want to make any assumptions about what the frontend would expect and adding the limit parameter should be a trivial task. It just seemed like it wouldn't be necessary, although I can see how defining all possible parameters would be helpful.

Personally, I would have a new PR+Issue dedicated to finalizing our consuming the API---make a bunch of functions to wrap all functionality we will need, and have them correctly handle refreshing tokens, errors, etc.