From 33fd4442dd8297d02d284e82cf09bbfec01c705a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 26 Jul 2022 22:23:37 +0200 Subject: add youtube backend --- wrms.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'wrms.go') diff --git a/wrms.go b/wrms.go index 4df78fa..12d7fd7 100644 --- a/wrms.go +++ b/wrms.go @@ -91,7 +91,14 @@ func (wrms *Wrms) AddSong(song Song) { } func (wrms *Wrms) Next() { - wrms.CurrentSong = *wrms.Queue.PopSong() + next := wrms.Queue.PopSong() + if next == nil { + wrms.CurrentSong.Uri = "" + return + } + + wrms.CurrentSong = *next + for i, s := range wrms.Songs { if s.Uri == wrms.CurrentSong.Uri { wrms.Songs[i] = wrms.Songs[len(wrms.Songs)-1] -- cgit v1.2.3