Commit 886979ad authored by LoveEevee's avatar LoveEevee

Allow non-standard genre field, add genre to osu songs

parent 8bc9aee5
......@@ -148,13 +148,15 @@
}
if(category){
var metaPath = file.webkitRelativePath.toLowerCase().slice(0, file.name.length * -1)
this.tjaFiles.forEach(fileObj => {
var filesLoop = fileObj => {
var tjaPath = fileObj.file.webkitRelativePath.toLowerCase().slice(0, fileObj.file.name.length * -1)
if(tjaPath.startsWith(metaPath) && (!("categoryLevel" in fileObj) || fileObj.categoryLevel < level)){
fileObj.category = category
fileObj.categoryLevel = level
}
})
}
this.tjaFiles.forEach(filesLoop)
this.osuFiles.forEach(filesLoop)
}
}).catch(() => {})
reader.readAsText(file, "sjis")
......@@ -193,8 +195,8 @@
if(meta.wave){
songObj.music = this.otherFiles[dir + meta.wave.toLowerCase()]
}
if(meta.genre in this.categories){
songObj.category = this.categories[meta.genre]
if(meta.genre){
songObj.category = this.categories[meta.genre.toLowerCase()] || meta.genre
}
}
if(!songObj.category){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment