{"artist": "Savatage","album": ""Streets" A Rock Opera","title": "Believe","track_number": "16","duration": "5:42"}
Since json doesn't permit single or double quotes without being escaped, I was attempting to use # as shown in mpc man page. I must be using it incorrectly since it's not working:
The [] operator is used to group output such that if no metadata delimiters are found or matched
between [ and ], then none of the characters between [ and ] are output. & and | are logical
operators for and and or. # is used to escape characters. Some useful examples for format are:
"%file%" and "[[%artist% - ]%title%]|[%file%]". This command also takes the following defined
escape sequences:
Can anyone explain how to use # to escape quote chars in a field?
nnet wrote: ↑August 8th, 2019, 4:27 pm
Can anyone explain how to use # to escape quote chars in a field?
Not at all. mpc never quotes its output. The "#" may be used to quote special characters in the format specification.
If you want to quote output values, mpc is the wrong tool for the job. Better write a Python two-liner using a MPD client library and a JSON formatting library.
Ah ok, I misunderstood its use then, it doesn't filter output, it provides a means of escaping arbitrary characters supplied in the format template.
Thanks for the response and explanation!