From 577514bbf1a2a92187fa8ab93b696c4ca6ba1167 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 8 Aug 2019 20:07:55 -0300 Subject: Show duration of selected item in context menu This takes the place of the number of direct children items (opting to show just the total number of tracks). --- ui.js | 6 ++++-- 1 file 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 }, -- cgit 1.3.0-6-gf8a5