I am using mpc as client but if I understand the protocol definition¹ correctly, this applies to other clients as well: How can I add and play a song (actually, a web stream) in one step?
Currently, I am doing "mpc insert $URL && mpc next" (which is not one step, but that's ok) but it turns out that this works only when mpd is already playing a song. I wonder why this is the case (as the documentation¹ for the "next" command says "Plays next song in the playlist.") and whether there exists an alternative?
I am not sure how I could use the "play" command in this scenario, since for that I would have to find out at which position the song was added to the queue?!
(What works well is "mpc clear && mpc add $URL && mpc play" but obviously that empties the queue which is not what I want.)
I suppose the scenario is common enough that there's a simple solution which I just oversaw.
P.S.: A solution for how to get rid of "stale" streams from the queue is also very welcome. With "stale" I mean streams that remain in the queue using the approach described above when switching to another $URL. Is there any way to only remove streams from the queue?
¹ https://musicpd.org/doc/html/protocol.h ... g-playback
Need help with MPD?
3 posts • Page 1 of 1