mvantassel / plexpy2influx

Pipe select PlexPy metrics to InfluxDB so it can be graphed in Grafana
MIT License
7 stars 5 forks source link

Playing music results in an error as there is no resolution associated with it #10

Closed krohrsb closed 6 years ago

krohrsb commented 6 years ago

When playing music, plexpy2influx generates invalid data to be sent to influx.

message: 'A 400 Bad Request error occurred: {"error":"unable to parse \'sessions,resolution= direct_stream_count=1,direct_stream_playing_count=1,total_stream_count=1,total_stream_playing_count=1,transcode_stream_count=0,transcode_stream_playing_count=0\': missing tag value"}\n' }

Assume its associated with the fact that resolution= has no value.

mvantassel commented 6 years ago

hey @blackbarn, thanks for logging an issue.

I don't have music in my plex but I'll get around to adding a song so I can reproduce what's going on here.

mvantassel commented 6 years ago

Added a check that should resolve this issue.

let tags = { resolution: data.type ? data.type.toLowerCase() : null };