« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui.js b/ui.js
index 9dba6d6..81108aa 100644
--- a/ui.js
+++ b/ui.js
@@ -947,12 +947,13 @@ class AppElement extends FocusElement {
   }
 
   actOnQueuePlayers(fn) {
-    if (this.queuePlayersToActOn.length) {
-      for (const queuePlayer of this.queuePlayersToActOn) {
-        fn(queuePlayer)
+    const actOn = this.queuePlayersToActOn.length ? this.queuePlayersToActOn : [this.SQP]
+    for (const queuePlayer of actOn) {
+      fn(queuePlayer)
+      const PIE = this.getPlaybackInfoElementForQueuePlayer(queuePlayer)
+      if (PIE) {
+        PIE.updateProgress()
       }
-    } else {
-      fn(this.SQP)
     }
   }