« get me outta code hell

Fix duplicate sound problem, hopefully - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-05-30 23:54:39 -0300
committerFlorrie <towerofnix@gmail.com>2018-05-30 23:54:39 -0300
commit12e2b37d59b29343e4543abbfb2416625a1ab79f (patch)
treedd41dba063dc629c077787f54f5af47a8aa7e90e
parentc67983ea0c540e52ca8bb60b8136ecade9447b79 (diff)
Fix duplicate sound problem, hopefully
-rw-r--r--ui.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui.js b/ui.js
index 1704964..f293671 100644
--- a/ui.js
+++ b/ui.js
@@ -78,7 +78,7 @@ class AppElement extends FocusElement {
     super.keyPressed(keyBuf)
   }
 
-  async queueGrouplikeItem(item) {
+  async queueGrouplikeItem(item, play = true) {
     // TODO: Check if it's an item or a group
 
     const items = this.queueGrouplike.items
@@ -96,7 +96,7 @@ class AppElement extends FocusElement {
     items.push(item)
     this.queueListingElement.buildItems()
 
-    if (!this.playingTrack) {
+    if (play && !this.playingTrack) {
       this.playGrouplikeItem(item)
     }
   }
@@ -164,7 +164,7 @@ class AppElement extends FocusElement {
       if (!nextItem) {
         return
       }
-      this.queueGrouplikeItem(nextItem)
+      this.queueGrouplikeItem(nextItem, false)
       queueIndex = queue.items.length - 1
     }