From 83955866c97a0fc611e271cbca4f5f4723b0ce76 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 8 Oct 2023 02:56:19 +0400 Subject: [PATCH] Alter an artist tag to tell that there is nothing left to play, so a fallback song is used to fill a silence. --- internal/http/dj_handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/http/dj_handlers.go b/internal/http/dj_handlers.go index 180c8b9..3686130 100644 --- a/internal/http/dj_handlers.go +++ b/internal/http/dj_handlers.go @@ -7,6 +7,7 @@ import ( "fmt" "log" "net/http" + "strings" "time" ) @@ -76,6 +77,10 @@ func (dj *DJHandlers) PlaylistNext(w http.ResponseWriter, _ *http.Request) { MaxListeners: dj.listeners.Current(), StartAt: time.Now()} + if strings.HasSuffix(nxt, "/fallback.ogg") { + song.Artist = "Nothing to play. Playing a fallback: " + song.Artist + } + if dj.songList.Current() != nil { dj.mostLSong.Update(*dj.songList.Current()) }