Closed Delapouite closed 9 years ago
Done. Tokens are now Strings rather than Numbers I also improved custom so that it can use a "parser"
For instance: socket.emit("custom", {token: "mytoken", command: "lsinfo \"some path\"", stopper: "\nOK\n"}); will return the exact MPD string
but socket.emit("custom", {token: "mytoken", command: "lsinfo \"some path\"", stopper: "\nOK\n", parser: "entries"}); will return the MPD content parsed as json
or socket.emit("custom", {token: "mytoken", command: "status", parser: "status"}); will return the MPD status parsed as json
(this is not documented yet in readme)
PS, forgot to say: in REST API, custom is now POST
The same token mecanism used by the search command to match answer when they get back on the client.