diff --git a/asteroid.lisp b/asteroid.lisp index 8db2551..cbddc52 100644 --- a/asteroid.lisp +++ b/asteroid.lisp @@ -825,22 +825,24 @@ "Main front page" ;; Register this visitor for geo stats (captures real IP from X-Forwarded-For) (register-web-listener) - (clip:process-to-string - (load-template "front-page") - :title "ASTEROID RADIO" - :station-name "ASTEROID RADIO" - :status-message "🟢 LIVE - Broadcasting asteroid music for hackers" - :listeners "0" - :stream-quality "128kbps MP3" - :stream-base-url *stream-base-url* - :curated-channel-name (get-curated-channel-name) - :default-stream-url (format nil "~a/asteroid.aac" *stream-base-url*) - :default-stream-encoding "audio/aac" - :default-stream-encoding-desc "AAC 96kbps Stereo" - :now-playing-artist "The Void" - :now-playing-track "Silence" - :now-playing-album "Startup Sounds" - :now-playing-duration "∞")) + (let ((now-playing-stats (icecast-now-playing *stream-base-url*))) + (clip:process-to-string + (load-template "front-page") + :title "ASTEROID RADIO" + :station-name "ASTEROID RADIO" + :status-message "🟢 LIVE - Broadcasting asteroid music for hackers" + :listeners "0" + :connection-error (not now-playing-stats) + :stream-quality "128kbps MP3" + :stream-base-url *stream-base-url* + :curated-channel-name (get-curated-channel-name) + :default-stream-url (format nil "~a/asteroid.aac" *stream-base-url*) + :default-stream-encoding "audio/aac" + :default-stream-encoding-desc "AAC 96kbps Stereo" + :now-playing-artist "The Void" + :now-playing-track "Silence" + :now-playing-album "Startup Sounds" + :now-playing-duration "∞"))) ;; Frameset wrapper for persistent player mode (define-page frameset-wrapper #@"/frameset" () diff --git a/template/front-page.ctml b/template/front-page.ctml index 984b714..96d6f0a 100644 --- a/template/front-page.ctml +++ b/template/front-page.ctml @@ -117,7 +117,9 @@ -
+
+ (asteroid::load-template "partial/now-playing") +
diff --git a/template/partial/now-playing.ctml b/template/partial/now-playing.ctml index 367adf3..3c51130 100644 --- a/template/partial/now-playing.ctml +++ b/template/partial/now-playing.ctml @@ -8,11 +8,11 @@ ☆
-

Listeners: 1

+

Listeners: 1

+ + +

- - -