-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add playlists and playlist items #314
Conversation
No longer a draft, since we have matching PR in web, and all the actions are now working as expected |
a67dff7
to
544f192
Compare
40df93b
to
b4c6d27
Compare
b4c6d27
to
d88df46
Compare
(Pushed a rebase since this branch didn't include the flake yet.) |
Updated the merging strategy of tracks and artists to make sure this works when they are in the same playlist. @chvp Maybe take a short look at the changes |
Sorry - one more change, since the current result of |
@chvp my last commit only contains some reformatting - both before and after should pass our rubocop config, but i felt that a multiline lamdba made more sense here. Feel free to drop this commit if you disagree |
This PR adds a basic implementation of Playlists and exposes this through the API.
The concept of a Playlist is currently the following:
This allows us to create playlist like 'My favorite songs', 'My top 10 albums of 2022', 'All artists playing at festival X'
My primary reasoning for this distinction is for subjective and objective lists. 'Robbe's top 10 ambient albums' would be a personal list. 'All artists playing at Rewire 2022' is an objective list that everyone can add to. Another option for a shared list could be 'Music for our road trip'
Questions
Private playlists?
I was doubting to allow a user to make their personal playlists private. Currently all users can see all playlists, where a private playlist would only be visible to the user the list belongs to. I didn't think I'd ever mark a playlist private, but if there is a need for it, I wouldn't mind it either.Private playlists are now added
PlaylistItem
needed?We currently store the playlist items in a separate model/table. Mostly so we can use Rails' builtins for associations, and store order as an explicit field.
However, at the moment our only interaction with these items is through the
item_ids
getter/setter, so we don't necessarily need a separate model / table, but also might storeitem_ids
in a json/jsonb type column on the playlists table. This would also allow us to remove the checks on the playlist's type and the item's item_type