« get me outta code hell

getNameScore algorithm todo - 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-24 00:42:59 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-03-24 00:42:59 -0300
commitc685a6bb545b80192aa6aeaa0654a8390c5ea755 (patch)
treecfb6b2920fb36bf016d791ec59027b31522d6651
parentbbca8d151cdf498bc67f3936859f8ab2299d5eac (diff)
getNameScore algorithm todo
-rw-r--r--playlist-utils.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/playlist-utils.js b/playlist-utils.js
index 317ff84..899a349 100644
--- a/playlist-utils.js
+++ b/playlist-utils.js
@@ -837,6 +837,24 @@ function getNameScore(name1, name2) {
   // length of that series, so a higher score is better (and a zero score
   // means no overlap).
 
+  // TODO:
+  // This ain't perfect! Case example: User A has library structure:
+  //
+  //   Very Cool Album/
+  //     01 Beans
+  //
+  // User B has library structure:
+  //
+  //   Very Cool Album/
+  //     Very Cool Album- 01 Beans
+  //
+  // Now if user B queues 'Very Cool Album- 01 Beans', the search will match
+  // the *group* 'Very Cool Album' on User A's end, because that name has a
+  // 3-word match, in comparison to the track '01 Beans', which is only a
+  // 2-word match. Not sure what a proper solution here would be, but probably
+  // it'd involve somehow prioritizing series of words which match closer to
+  // the end!
+
   // Split into chunks of word characters, taking out any non-word (\W)
   // characters between.
   const toWords = name => name.split(/\W+/)