« get me outta code hell

basic command relay across socket clients - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/players.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-07-10 20:52:13 -0300
committerFlorrie <towerofnix@gmail.com>2020-07-10 20:52:13 -0300
commitd00b26b23d9b3fc1e54a4d117366f0f22e664135 (patch)
tree7bc214a0ca10eec5ea6ae5d641481409aa00cc6d /players.js
parent503a37ba4d7550f9c2ed1602e589a0142a20d10d (diff)
basic command relay across socket clients
Diffstat (limited to 'players.js')
-rw-r--r--players.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/players.js b/players.js
index 6624f0f..2056ed7 100644
--- a/players.js
+++ b/players.js
@@ -224,13 +224,15 @@ module.exports.ControllableMPVPlayer = class extends module.exports.MPVPlayer {
   }
 
   setPause(val) {
-    this.isPaused = !!val
-    this.sendCommand('set', 'pause', this.isPaused)
+    if (!!val !== this.isPaused) {
+      this.togglePause()
+    }
   }
 
   setLoop(val) {
-    this.isLooping = !!val
-    this.sendCommand('set', 'loop', this.isLooping)
+    if (!!val !== this.isLooping) {
+      this.toggleLoop()
+    }
   }
 
   async kill() {