aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
diff options
context:
space:
mode:
Diffstat (limited to 'wrms.go')
-rw-r--r--wrms.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/wrms.go b/wrms.go
index cac60db..8b292c8 100644
--- a/wrms.go
+++ b/wrms.go
@@ -299,6 +299,14 @@ func (wrms *Wrms) Next() {
func (wrms *Wrms) _next() {
llog.DDebug("Next Song")
+ cmd := "play"
+
+ // Terminate the mpv process playing the current song
+ if wrms.Player.mpv.Load() != nil {
+ wrms.Player.Stop()
+ cmd = "next"
+ }
+
next := wrms.queue.PopSong()
if next == nil {
wrms.CurrentSong.Store(nil)
@@ -318,13 +326,9 @@ func (wrms *Wrms) _next() {
}
}
- var cmd string
+ // We are playing -> start playing the next song
if wrms.Playing {
wrms.Player.Play(next)
- cmd = "play"
- } else if wrms.Player.mpv != nil {
- wrms.Player.terminateMpv()
- cmd = "next"
}
wrms.rwlock.Unlock()