Commit e0bcb15

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-11-04 11:45:49
fix(ffmpeg): allow float input for `sanitize_time`
1 parent e943773
Changed files (1)
src
others
src/others/ffmpeg.py
@@ -111,7 +111,7 @@ async def ffmpeg_cut(client: Client, message: Message, **kwargs):
     await modify_progress(del_status=True, **kwargs)
 
 
-def sanitize_time(t: str) -> str:
+def sanitize_time(t: str | float) -> str:
     """Sanitize time string (HH:MM:SS.MILLISECONDS).
 
     10 -> 00:00:10
@@ -119,6 +119,7 @@ def sanitize_time(t: str) -> str:
     12:00 -> 00:12:00
     12:34:00 -> 12:34:00
     """
+    t = str(t)
     ctx = getcontext()
     ctx.prec = 3
     ctx.rounding = ROUND_DOWN