mod: 字符替换、跳转播放
This commit is contained in:
@ -142,4 +142,18 @@ class Utils {
|
||||
static String makeHeroTag(v) {
|
||||
return v.toString() + Random().nextInt(9999).toString();
|
||||
}
|
||||
|
||||
static int duration(String duration) {
|
||||
List timeList = duration.split(':');
|
||||
int len = timeList.length;
|
||||
if (len == 2) {
|
||||
return int.parse(timeList[0]) * 60 + int.parse(timeList[1]);
|
||||
}
|
||||
if (len == 3) {
|
||||
return int.parse(timeList[0]) * 3600 +
|
||||
int.parse(timeList[1]) * 60 +
|
||||
int.parse(timeList[2]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user