Fix listener count and recently-played rendering
- Use total listener count across all mounts instead of per-mount (asteroid.lisp icecast-status API, stream-harmony.lisp now-playing) - Fix recently-played.lisp: equal -> = for ParenScript string comparison - Remove non-existent asteroid-shuffle.mp3 mount from recently-played JS - Map all mount references to existing asteroid.mp3/asteroid.aac
This commit is contained in:
parent
fd1bc504a5
commit
6e23efe1e4
|
|
@ -1390,7 +1390,7 @@
|
|||
;; Return status from cl-streamer directly
|
||||
(let* ((now-playing (get-now-playing-stats "asteroid.mp3"))
|
||||
(title (if now-playing (cdr (assoc :title now-playing)) "Unknown"))
|
||||
(listeners (if now-playing (cdr (assoc :listeners now-playing)) 0)))
|
||||
(listeners (or (cl-streamer:get-listener-count) 0)))
|
||||
(api-output
|
||||
`(("icestats" . (("source" . (("listenurl" . ,(format nil "~a/asteroid.mp3" *stream-base-url*))
|
||||
("title" . ,title)
|
||||
|
|
|
|||
|
|
@ -27,12 +27,10 @@
|
|||
(defun get-current-mount-for-recently-played ()
|
||||
(let ((channel (get-current-channel))
|
||||
(quality (get-current-quality)))
|
||||
(if (= channel "shuffle")
|
||||
"asteroid-shuffle.mp3"
|
||||
(cond
|
||||
((= quality "low") "asteroid-low.mp3")
|
||||
((= quality "mp3") "asteroid.mp3")
|
||||
(t "asteroid.aac")))))
|
||||
(cond
|
||||
((= quality "low") "asteroid.mp3")
|
||||
((= quality "mp3") "asteroid.mp3")
|
||||
(t "asteroid.aac"))))
|
||||
|
||||
;; Update recently played tracks display
|
||||
(defun update-recently-played ()
|
||||
|
|
@ -43,7 +41,7 @@
|
|||
(then (lambda (result)
|
||||
;; Radiance wraps API responses in a data envelope
|
||||
(let ((data (or (ps:@ result data) result)))
|
||||
(if (and (equal (ps:@ data status) "success")
|
||||
(if (and (= (ps:@ data status) "success")
|
||||
(ps:@ data tracks)
|
||||
(> (ps:@ data tracks length) 0))
|
||||
(let ((list-el (ps:chain document (get-element-by-id "recently-played-list"))))
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@
|
|||
(cl-streamer/harmony:pipeline-current-track *harmony-pipeline*))
|
||||
(let* ((track-info (cl-streamer/harmony:pipeline-current-track *harmony-pipeline*))
|
||||
(display-title (or (getf track-info :display-title) "Unknown"))
|
||||
(listeners (cl-streamer:get-listener-count
|
||||
(format nil "/~A" mount)))
|
||||
(listeners (cl-streamer:get-listener-count))
|
||||
(track-id (or (find-track-by-title display-title)
|
||||
(find-track-by-file-path (getf track-info :file)))))
|
||||
`((:listenurl . ,(format nil "~A/~A" *stream-base-url* mount))
|
||||
|
|
|
|||
Loading…
Reference in New Issue