-
Notifications
You must be signed in to change notification settings - Fork 105
New Feature: Keyboard shortcut for 'like' toggle #200
Comments
@gamemasta0 the good news is, this shortcut already exists both in SoundCleod or on soundcloud.com. Just press the key 'L' to like/unlike the currently playing track. You can learn more about SoundCloud's built-in shortcuts by pressing '?'. I hope this helps. |
@salomvary I understand that, but that’s not what I’m talking about. I made a shortcut that can be accessed when the app is not focused! The ‘L’ shortcut only works when in-app. I want to be able to like a song when I’m in another app, like how the media keys can be used anywhere. Also, my question wasn’t how to do that, I’ve already built that. I’m trying to make a notification to give feedback to the user that the shortcut worked and also that they ‘liked’ or ‘disliked’ the song. Right now, it just says that the keyboard shortcut toggled ‘like’, but doesn’t say whether or not the song was ‘liked’ or ‘disliked’. Does the API have access to the ‘like’ status of the current track? |
@gamemasta0 Sorry, I missed the bit about a global shortcut. The "API" to programmatically trigger like/unlike is here: Lines 34 to 36 in b7a5658
This is for example how the main menu uses it: Lines 160 to 164 in 13bd4e9
There is nothing implemented for reading like status right now, you can do something similar to how Lines 12 to 19 in b7a5658
I imagine you will actually have to implement this in multiple steps:
I hope this now actually helps. Catching that "track was liked" event from SoundCloud will be a tricky one, it might involve digging into some internals on soundcloud.com. |
You might find some useful bits about getting the like status on this now abandoned pull request: #148. |
I'm trying to write a new keyboard shortcut into soundcleod and have got the functionality down - a keyboard shortcut now toggles 'like' of the current track - but I don't know how to get the track data to describe in a notification what track has been liked and if a like was added or removed by pressing the shortcut.
The only code I've had to write to make this happen so far with a generalized notification "Track Like Toggled" is the following in main.js:
I used similar notification code to the function soundcloud.on('play-new-track'), but I don't know how to implement a similar soundcloud.on('track-liked') and soundcloud.on('track-disliked'). Is this possible with the SoundCloud API included in soundcleod? Is there documentation on the API? I was unable to locate it myself.
The text was updated successfully, but these errors were encountered: