Set_shuffle service for media_player

Most media players have some ability to set shuffle. Often it’s not just an on/off. For example, Logitech Media Server supports shuffle by song / shuffle by album.

Kodi exposes kodi_set_shuffle, but it’s not documented on the component page.

I propose a standardized “set_shuffle” that will work as-needed per platform (sometimes an on/off, sometimes a specific shuffle mode).

BTW - If someone’s able to add this for Logitech Media Server / Squeeze component, the call to the API looks like:

curl -X GET \
    -H "Content-Type: application/json" \
    -d '{"id":1,"method":"slim.request","params":["bc:5f:xx:xx:xx:xx",["playlist","shuffle",1]]}' \
    http://192.168.1.110:xx/jsonrpc.js

Where that “1” means shuffle songs. A 2 would be shuffle by album. Omitting the payload completely toggles shuffle mode.

For Spotify, the API call for shuffle is documented here:
https://developer.spotify.com/web-api/toggle-shuffle-for-users-playback/

2 Likes

I’m with you on this, brother. I’m just starting to make use of my media players “other features” and this would be a welcome addition.

Sigh.

I took a look at adding this to Squeeze. Looks like it’ll be easy for someone that knows what they’re doing to add support for setting the shuffle. But that someone isn’t me. I got bogged down in trying to figure out the right way to define things.

async_media_previous_track and similar functions already make a call to Squeeze that’s similar to the one needed to set shuffle.

Would be nice to have it for MPD players as well:

https://pythonhosted.org/python-mpd2/topics/commands.html?highlight=shuffle#MPDClient.shuffle