seek from ugc intro

Closes #1303

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-24 10:36:33 +08:00
parent ec1bdb243f
commit 6ced89f30b
2 changed files with 30 additions and 7 deletions

View File

@@ -17,11 +17,12 @@ abstract class DurationUtils {
: "${h.toString().padLeft(2, '0')}:${m.toString().padLeft(2, '0')}:$sms";
}
static final _splitRegex = RegExp(r'[:]');
static int parseDuration(String? data) {
if (data == null || data.isEmpty) {
return 0;
}
List<int> split = data.split(':').reversed.map(int.parse).toList();
List<int> split = data.split(_splitRegex).reversed.map(int.parse).toList();
int duration = 0;
for (int i = 0; i < split.length; i++) {
duration += split[i] * pow(60, i).toInt();