mod: 字符替换、跳转播放

This commit is contained in:
guozhigq
2023-06-24 16:54:39 +08:00
parent f522886dc2
commit 7174eef890
8 changed files with 43 additions and 26 deletions

View File

@ -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;
}
}