From d2db23be5d490ec18ef5216922c8fbad71178dd8 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 12 May 2024 03:57:54 +0400 Subject: [PATCH] Now that only current number of listeners is being shown, send just it instead of a whole ListenerCounter. --- internal/http/dj_handlers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/http/dj_handlers.go b/internal/http/dj_handlers.go index 824bf7a..2e20f0b 100644 --- a/internal/http/dj_handlers.go +++ b/internal/http/dj_handlers.go @@ -133,12 +133,12 @@ func (dj *DJHandlers) Status(w http.ResponseWriter, r *http.Request) { } err = json.NewEncoder(w).Encode(&struct { - Current *radio.Song `json:"current_song,omitempty"` - Listeners *radio.ListenerCounter `json:"listeners"` - List []radio.Song `json:"last_songs,omitempty"` + Current *radio.Song `json:"current_song,omitempty"` + Listeners int64 `json:"listeners"` + List []radio.Song `json:"last_songs,omitempty"` }{ Current: dj.curSong, - Listeners: dj.listeners, + Listeners: dj.listeners.Current(), List: lst}) if err != nil { log.Println("DJHandlers.Status:", err)