Can you set a Spotify autoplay URI to randomise song order?

I’ve set up my MusicBox to autoplay a Spotify playlist on start up, and I notice it says “random: off” on the startup output, and thus plays the playlist in sequential order.

Is there either a setting, or something I can add to the Spotify URI to switch that to random: on each time it starts?

Thanks!

The auto play functionality lives at the bottom of https://github.com/woutervanwijk/Pi-MusicBox/blob/master/filechanges/opt/musicbox/startup.sh You can add another mpc command at the bottom there to enable random mode. I’d imagine it’s something along the lines of ‘mpc random on’. Might be worth putting it (and maybe also a next command) before the play command so it’s random from the start.

I’ve found and implemented the ‘mpc random on’ and it works a treat, however the ‘Play Queue’ shows the forthcoming tracks, but only in album order, not in the sequential order they will be played. Any idea’s how or where I could change this.

Check out the difference between random and shuffle in the Mopidy
documentation. Perhaps shuffle is the behaviour you want.

Thank you for responding,
From reading elsewhere as well, I think I would prefer shuffle to random, however when I change it in the startup.sh file it doesn’t work and reverts to playing each track in the normal order.

I notice in the ‘tracklistcontroller’ that is mentioned in the Mopidy documentation I could also turn on or off the ‘remove from tracklist when played’, how would I access that facility on my setup at home.
Sorry if I should have posted as a seperate topic.
Unfortunately my computing knowledge is quite limited but I am really enjoying the different challenges.

https://docs.mopidy.com/en/latest/api/core/#mopidy.core.TracklistController.consume
http://linux.die.net/man/1/mpc

So you would do mpc consume on to enable that mode.

Are you doing mpc shuffle or mpc shuffle on? The mpc manual linked above shows you need to use the former (as it’s an action rather than an option).

Thank you so much - but why is computing so frustrating!! I tried ‘mpc shuffle’ or ‘mpc shuffle on’ in all sorts of ways and places on the list yesterday, either before or after ‘play’ with and without colons, tried again following your advice and worked perfectly.
The ‘mpc consume on’ mode worked as well, does that change ongoing now or will I need to do ‘mpc consume on’ each time.
I’ve been through the link above and had a play with some of the other options, that was interesting, trouble is I could spend hours fiddling with bits and pieces :smile: thanks again,

That script runs at each boot and enables the option. Once enabled it’ll
stay on until you explicitly disable it.

It may be frustrating at times, but as you say, it can also provide hours
of fun!

I’ve got to be doing something wrong! I’ve changed /opt/musicbox/startup.sh to have the mpc repeat on command at the bottom. After reboot, however, an mpc command reports that repeat is off. Any suggestions on what I may be doing (or not doing)?

Thank you!

It depends what you have done to /opt/musicbox/startup.sh but normally if you don’t have the autoplay and autoplaywait variables in settings.ini then the autoplay function is disabled. Rather than changing startup.sh, I’d probably have something like the following in settings.ini:

autoplay = " ''; mpc random on"