mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
normalize search
This commit is contained in:
parent
15678eb173
commit
c81c3008fa
@ -110,8 +110,9 @@ class SongSelect{
|
|||||||
this.songs = []
|
this.songs = []
|
||||||
for(let song of assets.songs){
|
for(let song of assets.songs){
|
||||||
var title = this.getLocalTitle(song.title, song.title_lang)
|
var title = this.getLocalTitle(song.title, song.title_lang)
|
||||||
song.titlePrepared = fuzzysort.prepare(title)
|
song.titlePrepared = title ? fuzzysort.prepare(title.normalize("NFD").replace(/[\u0300-\u036f]/g, "")) : null
|
||||||
song.subtitlePrepared = fuzzysort.prepare(this.getLocalTitle(title === song.title ? song.subtitle : "", song.subtitle_lang))
|
var subtitle = this.getLocalTitle(title === song.title ? song.subtitle : "", song.subtitle_lang)
|
||||||
|
song.subtitlePrepared = subtitle ? fuzzysort.prepare(subtitle.normalize("NFD").replace(/[\u0300-\u036f]/g, "")) : null
|
||||||
this.songs.push(this.addSong(song))
|
this.songs.push(this.addSong(song))
|
||||||
}
|
}
|
||||||
this.songs.sort((a, b) => {
|
this.songs.sort((a, b) => {
|
||||||
@ -2972,7 +2973,7 @@ class SongSelect{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
query = editedSplit.join(" ").trim()
|
query = editedSplit.join(" ").trim().normalize("NFD").replace(/[\u0300-\u036f]/g, "")
|
||||||
|
|
||||||
var totalFilters = Object.keys(filters).length
|
var totalFilters = Object.keys(filters).length
|
||||||
for(var i = 0; i < assets.songs.length; i++){
|
for(var i = 0; i < assets.songs.length; i++){
|
||||||
|
Loading…
Reference in New Issue
Block a user