mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-12-22 17:26:13 +08:00
improve range parsing
This commit is contained in:
parent
a763028fa7
commit
70a047cd1c
@ -2896,9 +2896,12 @@ class SongSelect{
|
||||
parseRange(string){
|
||||
var range = string.split("-")
|
||||
if(range.length == 1){
|
||||
return {min: parseInt(range[0]), max: parseInt(range[0])}
|
||||
var min = parseInt(range[0]) || 0
|
||||
return min > 0 ? {min: min, max: min} : false
|
||||
} else if(range.length == 2){
|
||||
return {min: parseInt(range[0]), max: parseInt(range[1])}
|
||||
var min = parseInt(range[0]) || 0
|
||||
var max = parseInt(range[1]) || 0
|
||||
return min > 0 && max > 0 ? {min: min, max: max} : false
|
||||
}
|
||||
}
|
||||
|
||||
@ -2918,10 +2921,12 @@ class SongSelect{
|
||||
case "hard":
|
||||
case "oni":
|
||||
case "ura":
|
||||
filters[parts[0]] = this.parseRange(parts[1])
|
||||
var range = this.parseRange(parts[1])
|
||||
if (range) { filters[parts[0]] = range }
|
||||
break
|
||||
case "extreme":
|
||||
filters.oni = this.parseRange(parts[1])
|
||||
var range = this.parseRange(parts[1])
|
||||
if (range) { filters.oni = this.parseRange(parts[1]) }
|
||||
break
|
||||
case "clear":
|
||||
case "silver":
|
||||
|
Loading…
Reference in New Issue
Block a user