fix for search.js split

This commit is contained in:
Bui
2022-03-22 00:44:28 +00:00
parent 7d3cff5cbe
commit f4f0081e3d
2 changed files with 17 additions and 4 deletions

View File

@@ -94,12 +94,14 @@ class SongSelect{
this.font = strings.font
this.search = new Search(this)
this.songs = []
for(let song of assets.songs){
var title = this.getLocalTitle(song.title, song.title_lang)
song.titlePrepared = title ? fuzzysort.prepare(this.normalizeSearch(title)) : null
song.titlePrepared = title ? fuzzysort.prepare(this.search.normalizeString(title)) : null
var subtitle = this.getLocalTitle(title === song.title ? song.subtitle : "", song.subtitle_lang)
song.subtitlePrepared = subtitle ? fuzzysort.prepare(this.normalizeSearch(subtitle)) : null
song.subtitlePrepared = subtitle ? fuzzysort.prepare(this.search.normalizeString(subtitle)) : null
this.songs.push(this.addSong(song))
}
this.songs.sort((a, b) => {
@@ -228,7 +230,6 @@ class SongSelect{
this.currentSongCache = new CanvasCache(noSmoothing)
this.nameplateCache = new CanvasCache(noSmoothing)
this.search = new Search(this)
this.difficulty = [strings.easy, strings.normal, strings.hard, strings.oni]
this.difficultyId = ["easy", "normal", "hard", "oni", "ura"]