Closed iyefrat closed 4 years ago
"pause 0" will toggle pause the song if playing, and play it if paused.
Why do you expect this?
From the documentation of the pause command:
Toggles pause/resumes playing, PAUSE is 0 or 1.
I thought this was meant to describe the behavior of pause 0
, meaning that it toggles the pause state. I just kind of assumed that pause 1
would force pause because what pause 1
does wasn't explicitly stated in the docs.
I also came across #856 after your reply (having not seen it when writing the first post here), I understand that the intended behavior is for pause 0
to resume and for pause 1
to pause. This isn't clear from the description, which refers to toggling (which makes me assume the deprecated behavior), and resuming, but if anything I'd think that pause 1
resumes since it is mentioned second.
A clearer documentation (to me at least) would be something like:
resumes or pauses playback. PAUSE is 0 or 1.
this way the 0/1 options correspond to the descriptions in order. I may be alone in this though, other people might assume that the first thing mentioned is the 1
state of the command, which I think is what the original description is going for. At any rate, for a command named pause
it is rather obvious which input would pause and which would resume, so maybe just remove the word toggle?
I'm just wondering though, why was the old behavior deprecated? It's what I want (and end up re-implementing on the client side) from a pause command, is there some technical issue with it?
And because I forgot to say the first time around, thank you for all of your hard work on mpd!
You're right, the documentation is not good, I'll improve it.
I'm just wondering though, why was the old behavior deprecated?
I don't know, I looked it up in the git history, and found commit a165ee25e8b, i.e. the text was copied from the ancient wiki, which used to be the only documentation MPD had long ago. But since the wiki doesn't exist anymore, and the source code has no hint about it (no code comment), I don't know. I guess this was deprecated before I joined the project. But you're right, such a feature should exist to avoid unnecessary roundtrips. I'll un-deprecate it.
Bug report
Describe the bug
When passing the command "pause 0" to the server, instead of toggling play/pause, it seems to just start the song if paused.
Expected Behavior
"pause 0" will toggle pause the song if playing, and play it if paused. "pause 1" will just pause the song if it isn't already.
Actual Behavior
"pause 1" does pause the song if playing, and does nothing if the song is paused. However, "pause 0" only starts the song if paused, but does not pause a playing song. The (according to the docs) deprecated "pause" command does toggle play/pause.
after starting the server, the following happened:
this is the process detailed in the logs later on.
Version
Log
here I start the server, input "pause 0" twice, then input "pause 1" twice, then input "pause" twice, and then kill the server. I don't know if the server processing the idle comannd a bazillion time is normal or not, that might have to do with the fact that I used the haskell library libmpd to send the commands to the server.