forslund / spotify-skill

Mycroft Skill to control spotify using the Spotify Connect API
Apache License 2.0
71 stars 38 forks source link

Add a way to play liked songs #125

Closed SoptikHa2 closed 4 years ago

SoptikHa2 commented 4 years ago

Is it possible to add command to play songs that I liked on Spotify? When I say play liked songs or play favorite songs, it plays other people's random playlists that are named like that.

forslund commented 4 years ago

I've looked through the api documentation and I don't see a way to get the user's liked songs at the moment. I do think you can create a playlist from your liked songs, this playlist should be usable "play the playlist liked songs"

If you find a way to find the user's liked tracks/albums through the API we could add this.

TheLastProject commented 4 years ago

I know it sounds confusing, but "Liked songs" as shown in the Spotify client actually refers to "Saved tracks": https://developer.spotify.com/documentation/web-api/reference/library/get-users-saved-tracks/

forslund commented 4 years ago

In that case it should be possible to handle it. :+1:

TheLastProject commented 4 years ago

I've been trying to implement this in https://github.com/TheLastProject/spotify-skill but I keep getting

Removing event mycroft-spotify.forslund:launch_librespot                                                                                                                    
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout                                                                                                          
 23:26:03.097 | INFO     | 20468 | Playback Control Skill |    No matches                                                                                                   

And I don't know why this is happening. So unless someone can give me a hint to resolve this I'm afraid I won't be able to implement this myself.

forslund commented 4 years ago

Looks like good progress in your fork.

I don't know your setup so I'll go through the basics, You need to connect and add a username (password isn't necessary unless you're on a Mark-1) on home. You'll need to start a Spotify instance yourself unless you're on a Mark-1 device.

My goto first check is to ask "what spotify devices are available" which will tell you if there's any issues connecting to your Spotify account or player.

forslund commented 4 years ago

Just tested your branch and looks like it works as you intended (at least for me). I'd be happy to accept a PR with this feature!

forslund commented 4 years ago

This should be resolved by #127 (through #131). Closing this issue.