1
0

Now that only current number of listeners is being shown, send just it instead of a whole ListenerCounter.

This commit is contained in:
Alexander Andreev 2024-05-12 03:57:54 +04:00
parent c8f71b205b
commit d2db23be5d
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -133,12 +133,12 @@ func (dj *DJHandlers) Status(w http.ResponseWriter, r *http.Request) {
} }
err = json.NewEncoder(w).Encode(&struct { err = json.NewEncoder(w).Encode(&struct {
Current *radio.Song `json:"current_song,omitempty"` Current *radio.Song `json:"current_song,omitempty"`
Listeners *radio.ListenerCounter `json:"listeners"` Listeners int64 `json:"listeners"`
List []radio.Song `json:"last_songs,omitempty"` List []radio.Song `json:"last_songs,omitempty"`
}{ }{
Current: dj.curSong, Current: dj.curSong,
Listeners: dj.listeners, Listeners: dj.listeners.Current(),
List: lst}) List: lst})
if err != nil { if err != nil {
log.Println("DJHandlers.Status:", err) log.Println("DJHandlers.Status:", err)