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.
This commit is contained in:
rlaphoenix 2024-04-03 23:22:30 +01:00
parent 10285c3819
commit 5d1b54b8fa
1 changed files with 1 additions and 1 deletions

View File

@ -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: