MPD icon indicating copy to clipboard operation
MPD copied to clipboard

Added command store {NAME} {REPLACE} to save the player queue to an existing playlist

Open geneticdrift opened this issue 1 year ago • 2 comments

by either replacing or appending to the existing list.

geneticdrift avatar Sep 18 '22 08:09 geneticdrift

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 as save FOO create (for backwards compatibility)
  • save FOO replace
  • save FOO append (does append 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?)

MaxKellermann avatar Sep 18 '22 10:09 MaxKellermann

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.

geneticdrift avatar Sep 19 '22 12:09 geneticdrift

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!

jcorporation avatar Sep 22 '22 19:09 jcorporation