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:
parent
22a6200ddb
commit
83955866c9
@ -7,6 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -76,6 +77,10 @@ func (dj *DJHandlers) PlaylistNext(w http.ResponseWriter, _ *http.Request) {
|
|||||||
MaxListeners: dj.listeners.Current(),
|
MaxListeners: dj.listeners.Current(),
|
||||||
StartAt: time.Now()}
|
StartAt: time.Now()}
|
||||||
|
|
||||||
|
if strings.HasSuffix(nxt, "/fallback.ogg") {
|
||||||
|
song.Artist = "Nothing to play. Playing a fallback: " + song.Artist
|
||||||
|
}
|
||||||
|
|
||||||
if dj.songList.Current() != nil {
|
if dj.songList.Current() != nil {
|
||||||
dj.mostLSong.Update(*dj.songList.Current())
|
dj.mostLSong.Update(*dj.songList.Current())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user