aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-05-31 18:14:25 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-05-31 18:14:25 +0200
commit0a8e25ea698333c73c50fc84e3334e1079606a10 (patch)
treecbb29a6c23de33214e67b951a75f1c554ba2fcef /wrms.go
parent1f89f1d22ced0bb107514efb7e861247c2941a70 (diff)
downloadWRMS-0a8e25ea698333c73c50fc84e3334e1079606a10.tar.gz
WRMS-0a8e25ea698333c73c50fc84e3334e1079606a10.zip
allow admins to skip or delete songs
Diffstat (limited to 'wrms.go')
-rw-r--r--wrms.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/wrms.go b/wrms.go
index 430e5a9..bc5c732 100644
--- a/wrms.go
+++ b/wrms.go
@@ -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")