Can you add a like button so I can save the current song to my favorites?
Hi, currently I use the AppleScript API to get information from Spotify, unfortunately it does not provide an endpoint to save / modify / delete tracks from a users playlist / saved library. A plausible way to add this feature anyhow would be to use the Web API, but this would require the user to authenticate the application with their Spotify account.
I'd also like this feature. What are your thoughts on allowing the user to sign in for additional features such as this? I'd be willing to work on this functionality, it's just a matter of whether you think that this is "in-scope" for SpotMenu. :)
I think it would be a neat feature as well, I sometimes wish I had this feature too 😄. But since this is an open source project, I don't know how I could securely store a client_id and client_secret. I wouldn't to ask users to create their own Spotify App just to use this feature. If you have any ideas that would be great!
That's a really good point that I hadn't thought of. I suppose we could spin up a small server solely to serve these keys (maybe using https://aws.amazon.com/lambda/)? Looks like Lambda has a pretty sweet free tier. I haven't used it myself but I've heard good things. Let me know what you think!
I've never used Lambda before either.
Spotify authorization flows So you think we should set up a Lambda server so we can use the Authorization Code Flow?
~~Actually, looks like we won't need to. Check this out: https://developer.spotify.com/web-api/authorization-guide/#implicit-grant-flow~~
~~Whoop, looks like we still need to store an ID somewhere.~~
Reviewing the docs for a third time, it looks like we don't need a secret key. Hooray!
These are some stellar docs, btw.
I haven't read the documentation thoroughly yet, but I think the problem with the Implicit Grand Flow is that the user won't receive a refresh token and once the access token expires the user will have to login again, which would be really annoying. I don't know how long an issued access token is valid. If it's valid for more than a couple a months, then this is ok, but using a toking that expires weekly or even hourly wouldn't be such a great idea.
Ooh, yeah, good point. Looks like the token expires after one hour. Might not be the best solution. :)
Then yeah looks like Lambda might be a good option. I'm more of a web dev guy myself (I've played around with OS X dev but it's certainly not my strong suit), so perhaps I can work on the Lambda business and you can work on the OS X side (which besides the UI would include providing a callback URI)?
I started implementing this "add to your music" button feature.
Currently, this is the backend: https://github.com/kmikiy/kmikiy-for-spotify which runs on Heroku. I am using a free dyno for this. The url for the backend is this: http://kmikiy-for-spotify.herokuapp.com/
The client side is being developed on the save-button branch. Right now only logging in works, that is, retrieving access and refresh tokens, and nothing else.
I'll try to add the actual save feature as soon as possible. Also, there is a lot of boilerplate code to write for example refreshing access tokens, querying whether or not the current song is saved already and displaying a ✔︎ and ✘ accordingly, etc.
Looks great! Anything I can do to help?
Checkout the save-button branch, build it and see how it works (follow the steps in the README.md to build it).
Known issues:
- If you restart the SpotMenu you will have to login again
- After you login the "save button" will only be updated when you skip to the next song
- If the popover hasn't been open for more than an hour then the save button might show the correct symbol until you skip to the next song (this is due to the that the access token may have expired and might not have been refreshed yet)
- There is no sign out button yet 😅
@camdenb
Looks great! Anything I can do to help?
If you could find out why it keeps hogging so much memory even after the webview has been dismissed that would be great 😃
Just found this little project. It's awesome! I was also hoping that a save song button would de awesome, but I see you're already working on that. Keep up the good work! Cheers!
Hi @kmikiy, how are you on this enhancement? I can try help in my free time, are you interested in it?
Hey @ManWithBear I haven't really been working on it lately. But if youre willing to help id be glad to start working on it again. The changes from the main branch need to be merged in to the save-button branch. In my previous comments I mentioned the current state of the save-button branch and its issues. Basically those need to be fixed and evrything should be working fine. If youre good at debugging memory leaks then that would help because im concerned about the current way spotify login works now. I think it might be leaking
Update on this? Would be keen on getting this as a feature, if at all possible now :))
@Zazerr To be honest I haven't worked on this feature for a while due to Spotify's limitations. I'll get back to this after I finish the requests that are currently in work in progress state
Hey, it would be amazing to see this feature. Thanks!
Would still love this aswell
+1...This would be a great feature!
I no longer use Mac, but I would just like to say that I think this feature would still be great if it is possible to implement.
+1 on this feature
+1
+1
I really love SpotMenu but need so much like button, +100500 on this feature
Anything I can do to contribute to this?
up up up
I found an alternative that uses Spotifys API instead of their AppleScript API: https://github.com/Peter-Schorn/SoftPlayer