« get me outta code hell

count only alphanumeric symbols in alphabetic sort - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-03-15 20:34:32 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-03-15 20:34:32 -0300
commit1fb903a227094b5995d807f7bfc1c3bb414b37e5 (patch)
tree4e161ff53255a6fa148e5a0e7071c1762ba211a1
parent9ab44f1d8c0986986ac5d5df102d69aa21040f39 (diff)
count only alphanumeric symbols in alphabetic sort
-rw-r--r--ui.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 5e9e6f9..8945ce0 100644
--- a/ui.js
+++ b/ui.js
@@ -1571,7 +1571,10 @@ class AppElement extends FocusElement {
       } else if (order === 'alphabetic') {
         item = {
           name: `${oldName} (alphabetic)`,
-          items: orderBy(flattenGrouplike(item).items, getNameWithoutTrackNumber)
+          items: orderBy(
+            flattenGrouplike(item).items,
+            t => getNameWithoutTrackNumber(t).replace(/[^a-zA-Z0-9]/g, '')
+          )
         }
       }
     } else {