Open IkeHunter opened 3 weeks ago
@JonathanHooth There's a lot to this issue, but it should be a bit more straight forward than the tracks store issue. Thought you might prefer this one over that one.
Changed "active" terminology to "current" to align with implementation for clubs and tracks.
Info
A "Jukebox" is an object that stores information related to the track queue, the current device, etc. Currently, the jukebox store just stores all available jukeboxes for the user. Ideally, the store should also include the currently selected jukebox, and access to the currently active spotify account. It should also be able to set the active jukebox, and set the active spotify account for that jukebox.
Tasks
Active Jukebox
currentJukebox
to redux slice:setCurrentJukeboxReducer
in slice reducerssetCurrentJukebox
to jukebox actions. This action should store the currently active jukebox in local storage (look at the users store to see how auth is stored in local storage), you probably only need to store the jukebox id.selectCurrentJukebox
selectorcurrentJukebox
is null is when the user is not a part of any clubs that have jukeboxesFor now, the user can have a different "current" jukebox for separate devices.
Jukebox Link
Note: A
jukeboxLink
is an object that attaches a spotify account to a jukebox, and allows a user to connect one spotify account to multiple jukeboxes (but only one can control playback at a time)spotifyAuth
attribute in the club store to the jukebox store, rename itactiveSpotifyAccount
selectClubSpotifyAuth
from clubs store toselectActiveSpotifyAccount
in the jukebox storethunkFetchClubSpotifyAuth
in clubs store tothunkFetchSpotifyAccount
in jukebox store.jukeboxId
, but in the clubs thunk it is given theclubId
- which means it may or may not work currently depending on if the ids are the same. That was a mistake.thunkSetActiveJukeboxLink
thunk that takes in a jukebox id and jukebox link object, makes appropriate network calls, returns new spotify account object. Create an action that abstracts this thunk (likesetActiveJukeboxLink
).Integration & Spotify Connection