diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-07-26 22:23:37 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-07-26 22:23:37 +0200 |
| commit | 33fd4442dd8297d02d284e82cf09bbfec01c705a (patch) | |
| tree | be15f36161859c24971f62b3f89c4effe9c1e349 /wrms.go | |
| parent | 7e15ad1d8af4ee27f6c1d31e7b1608e2d751c402 (diff) | |
| download | WRMS-33fd4442dd8297d02d284e82cf09bbfec01c705a.tar.gz WRMS-33fd4442dd8297d02d284e82cf09bbfec01c705a.zip | |
add youtube backend
Diffstat (limited to 'wrms.go')
| -rw-r--r-- | wrms.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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] |
