stanford-oval / thingpedia-common-devices

Thingpedia interface code for commonly used devices
Other
38 stars 28 forks source link

(Staging) Unable to add songs or podcasts to playlist in Spotify #406

Closed tonyespinoza1 closed 2 years ago

tonyespinoza1 commented 3 years ago

I've been unsuccessful in working with Playlists in Spotify. In the example below after I enter the name of my playlist (in this case spelled, "FLow") it plays a random song (neither from playlist or currently playing artist (sigur ros).

play sigur ros

I played music by Sigur Rós on Spotify. add to playlist

What playlist do you want to add to? FLow

I played songs on Spotify.

====
# main/0afb24ef-cf95-464a-b3c8-f35f62806365
#! timestamp: 2021-07-18T03:57:48.276Z
U: play sigur ros
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source.playable() filter contains(artists, null^^org.thingpedia.media-source:artist("sigur ros")) => @org.thingpedia.media-player.play(playable=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter contains(artists, "spotify:artist:6UUrUCIZtQeOf8tC0WuzRy"^^org.thingpedia.media-source:artist("Sigur Rós")) => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:0yQPpUq5BJyqah5m2Q5Stt"^^org.thingpedia.media-source:playable("Hoppípolla"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:07eGxuz8bL6QMsRqEe1Adu"^^org.thingpedia.media-source:playable("Svefn-g-englar"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:55gISxV37mffOW2DbSskT3"^^org.thingpedia.media-source:playable("Starálfur"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:1QUiA9aecDOOnf32A9ZrtW"^^org.thingpedia.media-source:playable("Untitled stanford-oval/genie-toolkit#3 - Samskeyti"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:3OAf2iksV6MRLzqtUglTDq"^^org.thingpedia.media-source:playable("Sæglópur"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:2zkZGzzWOzGwi1rtWv7mhZ"^^org.thingpedia.media-source:playable("Sigur 3 (Untitled)"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:0YTfMKGPhWhjS9wgzWvfaf"^^org.thingpedia.media-source:playable("Glósóli"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:4Rr3lN1BgJtrWNAp97wizI"^^org.thingpedia.media-source:playable("Varðeldur"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:0S9w3jx4cO9rSBcGwB16in"^^org.thingpedia.media-source:playable("Olsen olsen"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:3XNjxPoUphJfUD5BShkYat"^^org.thingpedia.media-source:playable("Gobbledigook"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]]
C: #[count=49];
#! timestamp: 2021-07-18T03:57:49.801Z
A: I played music by Sigur Rós on Spotify.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-18T03:57:56.347Z
U: add to playlist
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @com.spotify.add_song_to_playlist(song=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter contains(artists, "spotify:artist:6UUrUCIZtQeOf8tC0WuzRy"^^org.thingpedia.media-source:artist("Sigur Rós")) => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:0yQPpUq5BJyqah5m2Q5Stt"^^org.thingpedia.media-source:playable("Hoppípolla"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:07eGxuz8bL6QMsRqEe1Adu"^^org.thingpedia.media-source:playable("Svefn-g-englar"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:55gISxV37mffOW2DbSskT3"^^org.thingpedia.media-source:playable("Starálfur"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:1QUiA9aecDOOnf32A9ZrtW"^^org.thingpedia.media-source:playable("Untitled stanford-oval/genie-toolkit#3 - Samskeyti"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:3OAf2iksV6MRLzqtUglTDq"^^org.thingpedia.media-source:playable("Sæglópur"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:2zkZGzzWOzGwi1rtWv7mhZ"^^org.thingpedia.media-source:playable("Sigur 3 (Untitled)"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:0YTfMKGPhWhjS9wgzWvfaf"^^org.thingpedia.media-source:playable("Glósóli"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:4Rr3lN1BgJtrWNAp97wizI"^^org.thingpedia.media-source:playable("Varðeldur"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:0S9w3jx4cO9rSBcGwB16in"^^org.thingpedia.media-source:playable("Olsen olsen"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:3XNjxPoUphJfUD5BShkYat"^^org.thingpedia.media-source:playable("Gobbledigook"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]]
C: #[count=49];
C: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @com.spotify(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).add_song_to_playlist(song=id);
#! timestamp: 2021-07-18T03:57:57.277Z
A: What playlist do you want to add to?
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_slot_fill(playlist);
AT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @com.spotify(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).add_song_to_playlist(song=id);
#! timestamp: 2021-07-18T03:58:03.391Z
U: FLow
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @org.thingpedia.media-player.play(playable=id);
====
tonyespinoza1 commented 3 years ago

play don't stop believing

I played Don't Stop Believin' on Spotify. create playlist oval

I created a new playlist named oval. add song to playlist oval

Did you mean Get songs and then add a song to a playlist with name oval and name the id? Yes

Sorry, you cannot add songs to this playlist. add this song to playlist oval

Sorry, you cannot add songs to this playlist.

====
# main/3caae3e9-623d-4b44-8dd3-a9f5fe0720b7
#! timestamp: 2021-07-31T00:39:10.211Z
U: play don't stop believing
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source.playable() filter id =~ "don't stop believing" => @org.thingpedia.media-player.play(playable=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: (@org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter id =~ "don't stop believing")[1] => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { playable="spotify:track:4bHsxqR3GMrXTxEPLuK5ue"^^org.thingpedia.media-source:playable("Don't Stop Believin'"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
#! timestamp: 2021-07-31T00:39:12.532Z
A: I played Don't Stop Believin' on Spotify.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-31T00:39:21.442Z
U: create playlist oval
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @com.spotify.create_playlist(name="oval");
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: (@org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter id =~ "don't stop believing")[1] => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { playable="spotify:track:4bHsxqR3GMrXTxEPLuK5ue"^^org.thingpedia.media-source:playable("Don't Stop Believin'"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
C: @com.spotify(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).create_playlist(name="oval")
C: #[results=[
C:   { name="oval", __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
#! timestamp: 2021-07-31T00:39:22.598Z
A: I created a new playlist named oval.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-31T00:39:40.487Z
U: add song to playlist oval
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @com.spotify.add_song_to_playlist(playlist="oval", song=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: (@org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter id =~ "don't stop believing")[1] => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { playable="spotify:track:4bHsxqR3GMrXTxEPLuK5ue"^^org.thingpedia.media-source:playable("Don't Stop Believin'"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
C: @com.spotify(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).create_playlist(name="oval")
C: #[results=[
C:   { name="oval", __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
C: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @com.spotify(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).add_song_to_playlist(playlist="oval", song=id)
C: #[results=[]]
C: #[error=enum disallowed_action];
#! timestamp: 2021-07-31T00:39:50.163Z
A: Did you mean Get songs and then add a song to a playlist with name oval and name the id?
A: Sorry, you cannot add songs to this playlist.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_error;
#! timestamp: 2021-07-31T00:41:10.171Z
U: add this song to playlist oval
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).get_currently_playing() => @com.spotify(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).add_song_to_playlist(playlist="oval", song=id);
tonyespinoza1 commented 3 years ago

Same playlist. Next session. I did click on the spotify window... play soundtrack gladiator

Did you mean Get music that has name soundtrack gladiator and then play the id on Spotify? Yes

I played Now We Are Free - From "Gladiator" Soundtrack on Spotify. add this song to playlist oval

I added a song to a playlist for you named oval named Now We Are Free - From "Gladiator" Soundtrack.

====
# main/e8f43bbf-75c7-498e-89f3-ad22bae91a66
#! timestamp: 2021-07-31T00:44:41.265Z
U: play soundtrack gladiator
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source.playable() filter id =~ "soundtrack gladiator" => @org.thingpedia.media-player.play(playable=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: (@org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter id =~ "soundtrack gladiator")[1] => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { playable="spotify:track:1raWfcURBd1Q3W3K0ojDCM"^^org.thingpedia.media-source:playable("Now We Are Free - From \"Gladiator\" Soundtrack"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
#! timestamp: 2021-07-31T00:44:47.232Z
A: Did you mean Get music that has name soundtrack gladiator and then play the id on Spotify?
A: I played Now We Are Free - From "Gladiator" Soundtrack on Spotify.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-31T00:44:58.558Z
U: add this song to playlist oval
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).get_currently_playing() => @com.spotify.add_song_to_playlist(playlist="oval", song=id);
tonyespinoza1 commented 3 years ago

in this instance it added 50 songs to playlist "oval" instead of the one playing.

(seems the entity it's adding to the playlist is a queue/array rather than the currently playing song.)

image

====
# main/fe5cce10-1024-42f4-b290-31cf8da10b43
#! timestamp: 2021-07-31T01:20:27.755Z
U: play spotify
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source.playable() => @org.thingpedia.media-player.play(playable=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { playable="spotify:track:4ZtFanR9U6ndgddUvNcjcG"^^org.thingpedia.media-source:playable("good 4 u"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:0UsmyJDsst2xhX1ZiFF3JW"^^org.thingpedia.media-source:playable("Year,2015"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:7BFk1nSfwfkDOgnNNeY7Yn"^^org.thingpedia.media-source:playable("wish i dropped out like brakence interlude"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:0eRJI4VhEm6UqIdMbf4VyX"^^org.thingpedia.media-source:playable("Year 3000"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:5HCyWlXZPP0y6Gqq8TgA20"^^org.thingpedia.media-source:playable("STAY (with Justin Bieber)"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:5rJw9VsPNdfnV9Ar97xZG2"^^org.thingpedia.media-source:playable("K-LOVE Fan Awards: Songs of the Year (2015 Mash-Up)"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:1lrjBRhWKrd3YShBN4Un7c"^^org.thingpedia.media-source:playable("Bob Dylan"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:5BJs3aDrKYBRkzrhaVxf89"^^org.thingpedia.media-source:playable("After Me - 2021 Version"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:748mdHapucXQri7IAO8yFK"^^org.thingpedia.media-source:playable("Kiss Me More (feat. SZA)"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") },
C:   { playable="spotify:track:00ohIpPn9LkKpeIqhfIU9V"^^org.thingpedia.media-source:playable("K-Love Fan Awards: Songs of the Year (2014 Mash-Up)"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]]
C: #[count=50];
#! timestamp: 2021-07-31T01:20:29.804Z
A: I played music on Spotify.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-31T01:20:37.670Z
U: add song to oval
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).song() => @com.spotify.add_song_to_playlist(playlist="oval", song=id);
DownloadDone
gcampax commented 2 years ago

This was fixed at some point, and adding songs to playlists should work. Adding podcasts to playlists is not possible and that's a separate issue (I think it's a Spotify limittion).