mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: sponsor block
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -602,6 +602,22 @@ class Utils {
|
||||
return v.toString() + random.nextInt(9999).toString();
|
||||
}
|
||||
|
||||
static String formatDuration(int seconds) {
|
||||
int hours = seconds ~/ 3600;
|
||||
int minutes = (seconds % 3600) ~/ 60;
|
||||
int remainingSeconds = seconds % 60;
|
||||
|
||||
String minutesStr = minutes.toString().padLeft(2, '0');
|
||||
String secondsStr = remainingSeconds.toString().padLeft(2, '0');
|
||||
|
||||
if (hours > 0) {
|
||||
String hoursStr = hours.toString().padLeft(2, '0');
|
||||
return "$hoursStr:$minutesStr:$secondsStr";
|
||||
} else {
|
||||
return "$minutesStr:$secondsStr";
|
||||
}
|
||||
}
|
||||
|
||||
static int duration(String duration) {
|
||||
List timeList = duration.split(':');
|
||||
int len = timeList.length;
|
||||
|
||||
Reference in New Issue
Block a user