Refactor playlist store to load data on-demand instead of per-show
The playlist store is used to store all playlists that are used in the currently selected show. Once the show is changed in the UI, the stored playlists are replaced by the playlists of the newly selected show.
This is fine most of the time but as outlined in #132 (closed) there are cases in which we actually need playlists of other shows. This would be possible if we’d actually request the playlists we need to render our components and not the playlists of the currently active show.
Components will then be able to request a show with a lazy store reference, like this:
const { playlist, isLoading } = usePlaylist(show.playlist_id)
If the store already contains the playlist the reference would resolve almost immediately, if it doesn’t the data is requested from tank with a request to /api/v1/playlists/${id}
.