From: Christian Heller Date: Tue, 18 Feb 2025 12:55:00 +0000 (+0100) Subject: Restore decimal zeroes to VideoFile.duration milliseconds lost in previous commit. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bdb.prefix%7D%7D/unset_cookie?a=commitdiff_plain;h=7c38857ed7d889075ee6ca1ad5d3dbd498adc3d1;p=ytplom Restore decimal zeroes to VideoFile.duration milliseconds lost in previous commit. --- diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index 28fcab6..82fb7c5 100644 --- a/src/ytplom/misc.py +++ b/src/ytplom/misc.py @@ -452,8 +452,8 @@ class VideoFile(DbData): if self.duration_ms < 0: return '?' seconds_str = f'{_readable_seconds(self.duration_ms // ONE_MILLION)}' - return (seconds_str if short - else f'{seconds_str}.{self.duration_ms // ONE_MILLION}') + milliseconds_str = f'{self.duration_ms // ONE_MILLION}'.rjust(6, '0') + return seconds_str if short else f'{seconds_str}.{milliseconds_str}' @property def present(self) -> bool: