From 22712326b25b6328f7cbca8782df112e1a4557c1 Mon Sep 17 00:00:00 2001 From: KatieFrogs <23621460+KatieFrogs@users.noreply.github.com> Date: Mon, 28 Feb 2022 02:45:27 +0300 Subject: [PATCH] Workaround for an edge case --- public/src/js/songselect.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index aad1341..3a2427e 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -3059,8 +3059,10 @@ class SongSelect{ a[0].ranges = this.indexesToRanges(a[0].indexes) if(a[0].indexes.length > 1){ if(a[0].ranges.length > a[0].indexes.length / 2){ - score0 = -Infinity - a[0].ranges = null + if(a[0].target.indexOf(query) === -1){ + score0 = -Infinity + a[0].ranges = null + } }else if(a[0].ranges.length !== 1){ score0 -= 9000 } @@ -3071,8 +3073,10 @@ class SongSelect{ a[1].ranges = this.indexesToRanges(a[1].indexes) if(a[1].indexes.length > 1){ if(a[1].ranges.length > a[1].indexes.length / 2){ - score1 = -Infinity - a[1].ranges = null + if(a[1].target.indexOf(query) === -1){ + score1 = -Infinity + a[1].ranges = null + } }else if(a[1].ranges.length !== 1){ score1 -= 9000 }