« get me outta code hell

Make playGrouplikeItem / Play (from menu) work with groups - 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-07-25 13:59:51 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-25 13:59:51 -0300
commitcc039d94b1a2f54007519c8bdd00b0a58e07bdc0 (patch)
tree2e141079b75084c4d8ff73323f484a5367464804
parent3dc160666085bdec5076ad15655cd3ace23cd516 (diff)
Make playGrouplikeItem / Play (from menu) work with groups
-rw-r--r--ui.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 26512e4..3e6cdf6 100644
--- a/ui.js
+++ b/ui.js
@@ -562,7 +562,10 @@ class AppElement extends FocusElement {
       this.queueGrouplikeItem(item, false, this.playingTrack)
     }
 
-    // TODO: Check if it's an item or a group
+    // If it's a group, play the first track.
+    if (isGroup(item)) {
+      item = flattenGrouplike(item).items[0]
+    }
 
     playTrack: {
       // No downloader argument? That's no good - stop here.