mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 20:16:26 +08:00
seek from ugc intro
Closes #1303 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user