« get me outta code hell

name reordered groups for queuing - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2020-09-15 15:55:43 -0300
committer(quasar) nebula <towerofnix@gmail.com>2020-09-15 15:55:43 -0300
commit7c8cb5f3df821719a4187ca4c0fe3fb455f9529a (patch)
treefba30d111b70e2fdc0222c26fd87eaea3c713fd2
parent5d58951225dba66402fc113d390ec602043d263e (diff)
name reordered groups for queuing
cherry-picked in part from 4b171a6a!
-rw-r--r--ui.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/ui.js b/ui.js
index 5e6ef6e..ae3cf32 100644
--- a/ui.js
+++ b/ui.js
@@ -1468,15 +1468,24 @@ class AppElement extends FocusElement {
       this.SQP.playNext(playingTrack)
     }
 
+    const oldName = item.name
     if (isGroup(item)) {
       if (order === 'shuffle') {
-        item = {items: shuffleArray(flattenGrouplike(item).items)}
+        item = {
+          name: `${oldName} (shuffled)`,
+          items: shuffleArray(flattenGrouplike(item).items)
+        }
       } else if (order === 'shuffle-groups') {
         item = shuffleOrderOfGroups(item)
+        item.name = `${oldName} (group order shuffled)`
       } else if (order === 'reverse') {
-        item = {items: flattenGrouplike(item).items.reverse()}
+        item = {
+          name: `${oldName} (reversed)`,
+          items: flattenGrouplike(item).items.reverse()
+        }
       } else if (order === 'reverse-groups') {
         item = reverseOrderOfGroups(item)
+        item.name = `${oldName} (group order reversed)`
       } else if (order === 'alphabetic') {
         item = {
           name: `${oldName} (alphabetic)`,
@@ -1485,7 +1494,7 @@ class AppElement extends FocusElement {
       }
     } else {
       // Make it into a grouplike that just contains itself.
-      item = {items: [item]}
+      item = {name: oldName, items: [item]}
     }
 
     if (where === 'next' || where === 'next-selected' || where === 'end') {