Skip to content

Commit

Permalink
fix(Chapter): Cast values to int prior to formatting
Browse files Browse the repository at this point in the history
If left as float, then it parses as e.g., `7.0` instead of `07`. This leads to the timestamp format being completely off.
  • Loading branch information
rlaphoenix committed Apr 3, 2024
1 parent 10285c3 commit 5d1b54b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion devine/core/tracks/chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, timestamp: Union[str, int, float], name: Optional[str] = None
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:
Expand Down

0 comments on commit 5d1b54b

Please sign in to comment.