nroi / paracusia

Elixir library for MPD (Music Player Daemon)
MIT License
12 stars 2 forks source link

Custom JSON Encoding for PlayerState #6

Closed ghost closed 6 years ago

ghost commented 6 years ago

I use Phoenix to pass messages from paracusia in backend to vue in frontend. There are a few custom types in paracusia which cannot be encoded in JSON. Would it be possible to add something like '@derive Jason.Encoder' in from of 'defstruct' so that they can be encoded in JSON format ?

The custom type I found are: PlayerState PlayerState.Status MpdClient.AudioOutputs PlayerState.Stats

nroi commented 6 years ago

I've just committed to the master branch. I'm going to release it to hex.pm in the next few days if everything works as desired.

nroi commented 6 years ago

Released on version 0.2.9.