mirror of
https://github.com/onyx-and-iris/gobs-cli.git
synced 2026-04-18 07:03:37 +00:00
rename media-input to media
replace set-cursor with cursor which can now get/set cursor position
This commit is contained in:
12
util.go
12
util.go
@@ -64,3 +64,15 @@ func parseTimeStringToMilliseconds(timeStr string) (float64, error) {
|
||||
|
||||
return duration.Seconds() * 1000, nil
|
||||
}
|
||||
|
||||
func formatMillisecondsToTimeString(ms float64) string {
|
||||
totalSeconds := int(ms / 1000)
|
||||
hours := totalSeconds / 3600
|
||||
minutes := (totalSeconds % 3600) / 60
|
||||
seconds := totalSeconds % 60
|
||||
|
||||
if hours > 0 {
|
||||
return fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds)
|
||||
}
|
||||
return fmt.Sprintf("%02d:%02d", minutes, seconds)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user