fix: avoid icecast xml to be shown on frontend when there is no artist
This commit is contained in:
parent
6506f7d153
commit
136fa2fa74
|
|
@ -857,8 +857,10 @@
|
||||||
(let* ((source-section (subseq xml-string match-start
|
(let* ((source-section (subseq xml-string match-start
|
||||||
(or (cl-ppcre:scan "</source>" xml-string :start match-start)
|
(or (cl-ppcre:scan "</source>" xml-string :start match-start)
|
||||||
(length xml-string))))
|
(length xml-string))))
|
||||||
(title (or (cl-ppcre:regex-replace-all ".*<title>(.*?)</title>.*" source-section "\\1") "Unknown"))
|
(titlep (cl-ppcre:all-matches "<title>" source-section))
|
||||||
(listeners (or (cl-ppcre:regex-replace-all ".*<listeners>(.*?)</listeners>.*" source-section "\\1") "0")))
|
(listenersp (cl-ppcre:all-matches "<listeners>" source-section))
|
||||||
|
(title (if titlep (cl-ppcre:regex-replace-all ".*<title>(.*?)</title>.*" source-section "\\1") "Unknown"))
|
||||||
|
(listeners (if listenersp (cl-ppcre:regex-replace-all ".*<listeners>(.*?)</listeners>.*" source-section "\\1") "0")))
|
||||||
;; Return JSON in format expected by frontend
|
;; Return JSON in format expected by frontend
|
||||||
(api-output
|
(api-output
|
||||||
`(("icestats" . (("source" . (("listenurl" . ,(concatenate 'string *stream-base-url* "/asteroid.mp3"))
|
`(("icestats" . (("source" . (("listenurl" . ,(concatenate 'string *stream-base-url* "/asteroid.mp3"))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue