« 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/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 8d13f57..fb73061 100644
--- a/ui.js
+++ b/ui.js
@@ -565,6 +565,24 @@ class AppElement extends FocusElement {
     this.queueListingElement.selectAndShow(item)
   }
 
+  clearQueuePast(item) {
+    if (!this.config.canControlQueue) {
+      return
+    }
+
+    this.backend.clearQueuePast(item)
+    this.queueListingElement.selectAndShow(item)
+  }
+
+  clearQueueUpTo(item) {
+    if (!this.config.canControlQueue) {
+      return
+    }
+
+    this.backend.clearQueueUpTo(item)
+    this.queueListingElement.selectAndShow(item)
+  }
+
   deselectAll() {
     this.markGrouplike.items.splice(0)
   }
@@ -599,6 +617,10 @@ class AppElement extends FocusElement {
         {divider: true},
         canControlQueue && {label: 'Play later', action: () => this.playLater(item)},
         canControlQueue && {label: 'Play sooner', action: () => this.playSooner(item)},
+        {divider: true},
+        canControlQueue && {label: 'Clear past this track', action: () => this.clearQueuePast(item)},
+        canControlQueue && {label: 'Clear up to this track', action: () => this.clearQueueUpTo(item)},
+        {divider: true},
         canControlQueue && {label: 'Remove from queue', action: () => this.unqueue(item)}
       ]
     } else {