« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/loop-play.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/loop-play.js b/src/loop-play.js
index ad071c3..f01ee5f 100644
--- a/src/loop-play.js
+++ b/src/loop-play.js
@@ -452,11 +452,13 @@ class PlayController extends EventEmitter {
         }
       }
 
+      const groupIndexArr = (track && track.groupTrackIndex) || ['', '']
+
       fullStatusLine += processTemplateString(statusLineTemplate, Object.assign({
         index: track ? (track.overallTrackIndex[0] + 1) : '',
         trackCount: track ? (track.overallTrackIndex[1]) : '',
-        indexGroup: track ? (track.groupTrackIndex[0] + 1) : '',
-        trackCountGroup: track ? (track.groupTrackIndex[1]) : '',
+        indexGroup: groupIndexArr[0],
+        trackCountGroup: groupIndexArr[1],
         longIndex
       }, playerData))