mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
improve range parsing
This commit is contained in:
parent
a763028fa7
commit
70a047cd1c
@ -2896,9 +2896,12 @@ class SongSelect{
|
|||||||
parseRange(string){
|
parseRange(string){
|
||||||
var range = string.split("-")
|
var range = string.split("-")
|
||||||
if(range.length == 1){
|
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){
|
} 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 "hard":
|
||||||
case "oni":
|
case "oni":
|
||||||
case "ura":
|
case "ura":
|
||||||
filters[parts[0]] = this.parseRange(parts[1])
|
var range = this.parseRange(parts[1])
|
||||||
|
if (range) { filters[parts[0]] = range }
|
||||||
break
|
break
|
||||||
case "extreme":
|
case "extreme":
|
||||||
filters.oni = this.parseRange(parts[1])
|
var range = this.parseRange(parts[1])
|
||||||
|
if (range) { filters.oni = this.parseRange(parts[1]) }
|
||||||
break
|
break
|
||||||
case "clear":
|
case "clear":
|
||||||
case "silver":
|
case "silver":
|
||||||
|
Loading…
Reference in New Issue
Block a user