MPD
MPD copied to clipboard
Added command store {NAME} {REPLACE} to save the player queue to an existing playlist
by either replacing or appending to the existing list.
I agree that both features added are useful, but I find the protocol design rather clumsy. We have "save" which does one thing, and now we have "store" (a word which has roughly the same subjective meaning as "save) which does two slightly different things, chosen by one obscure parameter. I know the MPD protocol has accumulated quite a bit of obscurity and inconsistency across the last 19 years, but I think new commands should try to be better. Maybe the mode should just be the second parametr to the existing "save" command? Just a rough draft:
-
save FOO
is the same assave FOO create
(for backwards compatibility) -
save FOO replace
-
save FOO append
(doesappend
allow creating a new file if it does not yet exist? Do we need both modes? Create-or-append and append-only-and-fail-if-not-exists?)
For append
and replace
I think the expectation is that the playlist FOO
already exists. So following your draft I've changed the implementation to use the save
command with an optional MODE
argument, where create
is the default, and the other optional values are replace
and append
.
Great new feature. I had in the past already feature requests to implement this on client side. As soon this feature is merged I will implement support for it in libmpdclient and in myMPD!