diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-05-31 18:14:25 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-05-31 18:14:25 +0200 |
| commit | 0a8e25ea698333c73c50fc84e3334e1079606a10 (patch) | |
| tree | cbb29a6c23de33214e67b951a75f1c554ba2fcef /wrms.go | |
| parent | 1f89f1d22ced0bb107514efb7e861247c2941a70 (diff) | |
| download | WRMS-0a8e25ea698333c73c50fc84e3334e1079606a10.tar.gz WRMS-0a8e25ea698333c73c50fc84e3334e1079606a10.zip | |
allow admins to skip or delete songs
Diffstat (limited to 'wrms.go')
| -rw-r--r-- | wrms.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -126,6 +126,22 @@ func (wrms *Wrms) AddSong(song Song) { } } +func (wrms *Wrms) DeleteSong(songUri string) { + for i := 0; i < len(wrms.Songs); i++ { + s := &wrms.Songs[i] + if s.Uri != songUri { + continue + } + + wrms.Songs[i] = wrms.Songs[len(wrms.Songs)-1] + wrms.Songs = wrms.Songs[:len(wrms.Songs)-1] + + wrms.queue.RemoveSong(s) + wrms.Broadcast(newEvent("delete", []Song{*s})) + break + } +} + func (wrms *Wrms) Next() { llog.DDebug("Next Song") |
