« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'backend.js')
-rw-r--r--backend.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend.js b/backend.js
index ed1bd08..900a822 100644
--- a/backend.js
+++ b/backend.js
@@ -556,6 +556,16 @@ class QueuePlayer extends EventEmitter {
     this.pauseNextTrack = !!value
   }
 
+  get remainingTracks() {
+    const index = this.queueGrouplike.items.indexOf(this.playingTrack)
+    const length = this.queueGrouplike.items.length
+    if (index === -1) {
+      return length
+    } else {
+      return length - index - 1
+    }
+  }
+
   get playSymbol() {
     if (this.player && this.playingTrack) {
       if (this.player.isPaused) {