« 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.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui.js b/ui.js
index fa29fd6..a02c85f 100644
--- a/ui.js
+++ b/ui.js
@@ -587,14 +587,16 @@ class AppElement extends FocusElement {
         canControlQueue && {label: 'Remove from queue', action: () => this.unqueue(item)}
       ]
     } else {
+      const numTracks = countTotalItems(item)
+      const { string: durationString } = this.backend.getDuration(item)
       items = [
         // A label that just shows some brief information about the item.
         {label:
           `(${item.name ? `"${item.name}"` : 'Unnamed'}` +
           (isGroup(item) ? (
             ' -' +
-            ` ${item.items.length} item${item.items.length === 1 ? '' : 's'}` +
-            `, ${countTotalItems(item)} total`)
+            ` ${numTracks} track${numTracks === 1 ? '' : 's'}` +
+            `, ${durationString}`)
           : '') + ')',
           keyboardIdentifier: item.name
         },