Skip to content

Commit 52ac205

Browse files
zubeydecivelekzzacharo
authored andcommitted
fix(serializer):include hours in VTT timestamp formatting
1 parent 8b31b18 commit 52ac205

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cds/modules/records/serializers/vtt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ def resize_link(frame, size):
102102
def time_format(seconds):
103103
"""Helper function to convert seconds to vtt time format."""
104104
d = datetime.utcfromtimestamp(seconds)
105-
s = d.strftime("%M:%S.%f")
105+
s = d.strftime("%H:%M:%S.%f")
106106
return s[:-3]

tests/unit/test_serializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_vtt_serializer(video_record_metadata):
8787
]
8888

8989
# Check first and last timestamp
90-
assert start_times[0] == "00:00.000"
90+
assert start_times[0] == "00:00:00.000"
9191
assert end_times[-1] == VTT.time_format(
9292
float(video_record_metadata["_files"][0]["tags"]["duration"])
9393
)

0 commit comments

Comments
 (0)