From 5d1b54b8fa44bc5e100109196f0e4f921f61e9a9 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Wed, 3 Apr 2024 23:22:30 +0100 Subject: [PATCH] fix(Chapter): Cast values to int prior to formatting If left as float, then it parses as e.g., `7.0` instead of `07`. This leads to the timestamp format being completely off. --- devine/core/tracks/chapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devine/core/tracks/chapter.py b/devine/core/tracks/chapter.py index 371857c..cdb7426 100644 --- a/devine/core/tracks/chapter.py +++ b/devine/core/tracks/chapter.py @@ -41,7 +41,7 @@ class Chapter: seconds, ms = divmod(int(remainder * 1000), 1000) else: raise TypeError - timestamp = f"{hours:02}:{minutes:02}:{seconds:02}.{str(ms).zfill(3)[:3]}" + timestamp = f"{int(hours):02}:{int(minutes):02}:{int(seconds):02}.{str(ms).zfill(3)[:3]}" timestamp_m = TIMESTAMP_FORMAT.match(timestamp) if not timestamp_m: