« 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 <qznebula@protonmail.com>2024-05-16 19:17:07 -0300
commit9b7544a8c30e176bff9b8b9014719e9e6456fb63 (patch)
tree0061d1fb56aa954ae59e2491d07e0cd1ec1325af
parent8fd987bc0451f00e2eeeefc2aa6944b4806c9460 (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 041b530..af8b5d6 100644
--- a/playlist-utils.js
+++ b/playlist-utils.js
@@ -868,6 +868,24 @@ export 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+/)