Add 5 seconds to time.Now() to more accurately represent the time when a song actually starts to play.
This commit is contained in:
parent
46dbe72253
commit
7d4de3f6a6
@ -83,7 +83,10 @@ func (dj *DJHandlers) PlaylistNext(w http.ResponseWriter, _ *http.Request) {
|
||||
Title: oggf.GetTag("title"),
|
||||
Duration: oggf.GetDuration(),
|
||||
MaxListeners: dj.listeners.Current(),
|
||||
StartAt: time.Now()}
|
||||
// Here 5 seconds are being added because it is approximately the
|
||||
// time between the creation of this Song object and when ezstream
|
||||
// actually starts to play it.
|
||||
StartAt: time.Now().Add(5 * time.Second)}
|
||||
|
||||
if strings.HasSuffix(nxt, "/fallback.ogg") {
|
||||
song.Artist = "Nothing to play. Playing a fallback: " + song.Artist
|
||||
|
Loading…
Reference in New Issue
Block a user