redditmusicplayer
redditmusicplayer copied to clipboard
Like / Save Songs
It would be cool if you could 'Like' songs (maybe it also upvotes the songs) and then be able to retrieve and play all your liked songs.
Hey man.
First of all. Great project! I've been using it only for two days but man this is awesome.
I'd like to contribute when I have time. I've only skimmed the server code a bit, but it seems like you made this work with minimal or no persistent data stored on the server side? That's cool!
That being said, do you have any ideas of how a feature like this could work?
I was thinking maybe we could make it so that an upvote would count as a like. But then there's the issue of trying to segregate upvotes that are music, and those that are not. I'm not sure how you handle that in the client but I guess something like that would be needed for this approach.
Anyway. Great project. Thanks!
Yup, I'm not really storing anything. Just the session data so I can easily have clustered instances so login would work even if I reboot the server because of a code change.
We have a few options:
- Store the data locally using indexedDB or Web SQL with localStorage as fallback.
- Store the data on a server. Grab the data for logged in users and push changes to the server as they happen.
- Upvote on Reddit, filter out non-playable links, this would be a good step for downvoting and filtering out downvotes links as well
- The first approach is iffy. It will work, but people will lose their data if they switch browsers/ move computers.
- The second approach is okay, but it would require having a persistent database on your server. This will be useful for a lot of stuff that we may add in the future as well. But this is a big decision from going 100% client side to having a database.
- This would probably be the easiest to implement right now.
Which approach do you prefer?
Let's go with saving upvotes / downvotes. We could also have a separate list for saved posts.