« get me outta code hell

Tweak track-number regex to include any whitespace - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/playlist-utils.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-10-27 17:12:48 -0300
committerFlorrie <towerofnix@gmail.com>2019-10-27 17:14:10 -0300
commitcbc5d345786293acf14f317aab555498030061c2 (patch)
tree9bdf87bda490eae502aad1b27154a5e717ecc095 /playlist-utils.js
parentd9512b8a4a7c96adc1aafa101c1741a6e065b421 (diff)
Tweak track-number regex to include any whitespace
So tracks like '05 - Artist - Apple Banana.mp3' will just show as
'Artist - Apple Banana.mp3'. (Before, it showed cut off before the first
dash.)
Diffstat (limited to 'playlist-utils.js')
-rw-r--r--playlist-utils.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/playlist-utils.js b/playlist-utils.js
index 9c6f0ed..082a734 100644
--- a/playlist-utils.js
+++ b/playlist-utils.js
@@ -529,7 +529,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(?=\S)/
+  const regex = /^[0-9\-\s]+/
 
   // First we need to determine whether every track in the group even starts
   // with a track number.