diff options
-rw-r--r-- | playlist-utils.js | 18 |
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+/) |