« get me outta code hell

Make track number regex do what it's supposed to - 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>2019-05-08 13:42:40 -0300
committerFlorrie <towerofnix@gmail.com>2019-05-08 13:42:40 -0300
commit6ba08342206625bcabb224c8f8c30db9500597c4 (patch)
tree04a2d171bdcc8c9fe3ba061bdc06e79ed6f2b509
parent64aa6eeb01491d04464206d94ae82107acb3f140 (diff)
Make track number regex do what it's supposed to
-rw-r--r--playlist-utils.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/playlist-utils.js b/playlist-utils.js
index 6741dd0..d679ad7 100644
--- a/playlist-utils.js
+++ b/playlist-utils.js
@@ -543,7 +543,7 @@ function getNameWithoutTrackNumber(track) {
 
   // This is the expression that matches a track number at the start of
   // a track's title.
-  const regex = /^[0-9\-]*\s*/
+  const regex = /^[0-9\-]+\s(?=\S)/
 
   // First we need to determine whether every track in the group even starts
   // with a track number.