1
0

Alter an artist tag to tell that there is nothing left to play, so a fallback song is used to fill a silence.

This commit is contained in:
Alexander Andreev 2023-10-08 02:56:19 +04:00
parent 22a6200ddb
commit 83955866c9
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

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