Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • Icecast-Server Icecast-Server
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 116
    • Issues 116
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.OrgXiph.Org
  • Icecast-ServerIcecast-Server
  • Issues
  • #2198

status-json.xsl produces invalid output if field contains only "-" and optional whitespace

When my track hasn't title in tags, Icecast shows - instead of a blank line,(I suppose this status sends the client, mpd in my case, to Icecast server) so, I get json like this (see example) and this json isn't valid because "title" : - instead "title" : "-" . I checked it here - http://jsonlint.com/ So, I cant't do json_decode(), function returns null

 {
         "icestats": {
             "admin": "admin@admin",
             "host": "host.com",
             "location": "Moscow",
             "server_id": "Icecast 2.4.2",
             "server_start": "Fri, 15 May 2015 16:25:24 +0300",
             "server_start_iso8601": "2015-05-15T16:25:24+0300",
             "source": [
                 {
                     "audio_info": "channels=2;samplerate=44100;bitrate=192",
                     "channels": 2,
                     "genre": "various",
                     "listener_peak": 3,
                     "listeners": 0,
                     "listenurl": "http://mds.planeset.ru:8000/mds.mp3",
                     "samplerate": 44100,
                     "server_description": "Трансляции Модель Для Сборки
    музыка",
                     "server_name": "Модель для сборки - музыка",
                     "server_type": "audio/mpeg",
                     "stream_start": "Fri, 15 May 2015 16:25:33 +0300",
                     "stream_start_iso8601": "2015-05-15T16:25:33+0300",
                     
                      "title": -,

                     "dummy": null
                 },
                 {
                     "audio_info": "channels=2;samplerate=44100;bitrate=192",
                     "channels": 2,
                     "genre": "various",
                     "listener_peak": 10,
                     "listeners": 9,
                     "listenurl": "http://mds.planeset.ru:8000/mds_voice.mp3",
                     "samplerate": 44100,
                     "server_description": "Трансляции Модель Для Сборки -
    голос",
                     "server_name": "Модель для сборки - голос",
                     "server_type": "audio/mpeg",
                     "stream_start": "Fri, 15 May 2015 16:25:33 +0300",
                     "stream_start_iso8601": "2015-05-15T16:25:33+0300",
                     "title": "Фред Саберхаген - Доброжил",
                     "dummy": null
                 }
             ]
         }
    }

This is example of json, as You can see in first case I have title: - because of it I can not json_decode.

There is file xml2json.xslt from Doeke Zanstra https://github.com/doekman/xml2json-xslt on server. This file, I guess, convert xml to json and maybe there is a way to add new rule to convert - to null in blank title line, but I don't know how I can do it.

Assignee
Assign to
Time tracking