feat: frontpage now playing default fill

This commit is contained in:
Luis Pereira 2026-02-28 17:38:16 +00:00 committed by Brian O'Reilly
parent 6fd8071a05
commit 61266647a9
3 changed files with 25 additions and 21 deletions

View File

@ -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" ()

View File

@ -117,7 +117,9 @@
</c:if>
</div>
<div id="now-playing" class="now-playing"></div>
<div id="now-playing" class="now-playing">
<c:h>(asteroid::load-template "partial/now-playing")</c:h>
</div>
<!-- Recently Played Tracks -->
<div id="recently-played-panel" class="recently-played-panel">

View File

@ -8,11 +8,11 @@
<span class="star-icon">☆</span>
</button>
</div>
<p>Listeners: <span lquery="(text listeners)">1</span></p>
<p>Listeners: <span id="current-listeners" lquery="(text listeners)">1</span></p>
<input type="hidden" id="current-track-id" lquery="(val track-id)" value="">
<input type="hidden" id="favorite-count-value" lquery="(val favorite-count)" value="0">
<p class="favorite-count" id="favorite-count-display"></p>
</c:using>
<input type="hidden" id="current-track-id" lquery="(val track-id)" value="">
<input type="hidden" id="favorite-count-value" lquery="(val favorite-count)" value="0">
<p class="favorite-count" id="favorite-count-display"></p>
</c:then>
<c:else>
<c:if test="connection-error">