{"artist": "Savatage","album": ""Streets" A Rock Opera","title": "Believe","track_number": "16","duration": "5:42"}
A json option could be provided a list of fields to operate or just be an option that escapes quotes in its output regardless which fields are used in a template.
I am able to template a format for json use, but if a field contains
'
or"
, that breaks json.Here's an example of the template I used, result includes data with unescaped
"
:mpc -f '{"artist": "%artist%",["album": "%album%",]"title": "%title%",["track_number": "%track%",]"duration": "%time%"}' search album streets
{"artist": "Savatage","album": ""Streets" A Rock Opera","title": "Believe","track_number": "16","duration": "5:42"}
A json option could be provided a list of fields to operate or just be an option that escapes quotes in its output regardless which fields are used in a template.