diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-06-30 17:05:27 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-06-30 18:09:46 +0200 |
| commit | 1da552c5e9c0a110056537647b325e1107d8a6bb (patch) | |
| tree | 0efa0ee38a83b841a2acbe8194b868ff54b5429c /wrms.go | |
| parent | 51dbf50634fd3fd82f71cb1c64e0569c217828ae (diff) | |
| download | WRMS-1da552c5e9c0a110056537647b325e1107d8a6bb.tar.gz WRMS-1da552c5e9c0a110056537647b325e1107d8a6bb.zip | |
fix toggling of playing state in wrms.PlayPause
Diffstat (limited to 'wrms.go')
| -rw-r--r-- | wrms.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -339,17 +339,17 @@ func (wrms *Wrms) _next() { func (wrms *Wrms) PlayPause() { wrms.rwlock.Lock() // Toggle the playback state - defer func() { wrms.Playing = !wrms.Playing }() + wrms.Playing = !wrms.Playing - // Wrms is playing -> pause the player - if wrms.Playing { + // Wrms was playing -> pause the player + if !wrms.Playing { wrms.Player.Pause() wrms.rwlock.Unlock() wrms.Broadcast(newNotification("pause")) return } - // Wrms is not playing + // Wrms was not playing currentSong := wrms.CurrentSong.Load() // Wrms has no current song -> try to play the next song |
