« get me outta code hell

display duration in track context menu - 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>2020-03-13 12:09:15 -0300
committerFlorrie <towerofnix@gmail.com>2020-03-13 12:09:15 -0300
commitef66a8613ddc0584a1f08696261f62c19cd7db6e (patch)
tree55e22a2a9818d8d23d4c23ee40260801d39dba3a
parent2b671919525596b8afe1bdd442a562183a054398 (diff)
display duration in track context menu
-rw-r--r--todo.txt5
-rw-r--r--ui.js10
2 files changed, 9 insertions, 6 deletions
diff --git a/todo.txt b/todo.txt
index 418ee49..e039cc8 100644
--- a/todo.txt
+++ b/todo.txt
@@ -482,3 +482,8 @@ TODO: Opening the selection contxt menu should show an option to either add or
       selection accessible when a keyboard or the shift key is inaccessible.
 
 TODO: Integrate the rest of the stuff that handles argv into parseOptions.
+
+TODO: Figure out looping not always working consistently. I've tried to deal
+      with this before, but it's been broken since switching to socat. Maybe we
+      aren't receiving time data as consistently, or aren't re-applying loop
+      when we're supposed to?
diff --git a/ui.js b/ui.js
index 81108aa..f9f066e 100644
--- a/ui.js
+++ b/ui.js
@@ -1000,12 +1000,10 @@ class AppElement extends FocusElement {
       items = [
         // A label that just shows some brief information about the item.
         {label:
-          `(${item.name ? `"${item.name}"` : 'Unnamed'}` +
-          (isGroup(item) ? (
-            ' -' +
-            ` ${numTracks} track${numTracks === 1 ? '' : 's'}` +
-            `, ${durationString}`)
-          : '') + ')',
+          `(${item.name ? `"${item.name}"` : 'Unnamed'} - ` +
+          (isGroup(item) ? ` ${numTracks} track${numTracks === 1 ? '' : 's'}, ` : '') +
+          durationString +
+          ')',
           keyboardIdentifier: item.name
         },