aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-07-26 22:23:37 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2022-07-26 22:23:37 +0200
commit33fd4442dd8297d02d284e82cf09bbfec01c705a (patch)
treebe15f36161859c24971f62b3f89c4effe9c1e349 /wrms.go
parent7e15ad1d8af4ee27f6c1d31e7b1608e2d751c402 (diff)
downloadWRMS-33fd4442dd8297d02d284e82cf09bbfec01c705a.tar.gz
WRMS-33fd4442dd8297d02d284e82cf09bbfec01c705a.zip
add youtube backend
Diffstat (limited to 'wrms.go')
-rw-r--r--wrms.go9
1 files changed, 8 insertions, 1 deletions
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]