Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Icecast-Server
Icecast-Server
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 102
    • Issues 102
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Xiph.Org
  • Icecast-ServerIcecast-Server
  • Issues
  • #2198

Closed
Open
Opened May 16, 2015 by Zalex@Zalex
  • Report abuse
  • New issue
Report abuse New issue

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
Icecast 2.5.0
Milestone
Icecast 2.5.0
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: xiph/icecast-server#2198