xiph / Icecast-Server

Icecast streaming media server (Mirror) - Please report bugs at https://gitlab.xiph.org/xiph/icecast-server/issues
https://icecast.org
GNU General Public License v2.0
465 stars 127 forks source link

status-json.xsl returning invalid json when song title is not set #43

Closed devnulli closed 2 years ago

devnulli commented 3 years ago

Hi

When no description is provided for the currently streamed song, the value will be supplemented with -, and the resulting name value pair will become "title": -. In that case, the value misses quotes, and the result will become an invalid json.

{
  "icestats": {
    "admin": "icemaster@localhost",
    "host": "localhost",
    "location": "Earth",
    "server_id": "Icecast 2.4.4",
    "server_start": "Sun, 10 Jan 2021 21:04:08 +0100",
    "server_start_iso8601": "2021-01-10T21:04:08+0100",
    "source": {
      "audio_info": "channels=2;samplerate=44100;bitrate=128",
      "bitrate": 128,
      "channels": 2,
      "genre": "various",
      "listener_peak": 0,
      "listeners": 0,
      "listenurl": "http://localhost:8000/mpd",
      "samplerate": 44100,
      "server_description": "desc",
      "server_name": "name",
      "server_type": "audio/mpeg",
      "stream_start": "Sun, 10 Jan 2021 21:08:37 +0100",
      "stream_start_iso8601": "2021-01-10T21:08:37+0100",
      "title": -,
      "dummy": null
    }
  }
  }
devnulli commented 2 years ago

no longer an issue for me