mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-02 16:19:10 +00:00
fix: catch OverflowError when displaying video duration
This commit is contained in:
@@ -211,11 +211,14 @@ class FileAttributes(QWidget):
|
||||
|
||||
if duration_text:
|
||||
stats_label_text = add_newline(stats_label_text)
|
||||
dur_str = str(timedelta(seconds=float(duration_text)))[:-7]
|
||||
if dur_str.startswith("0:"):
|
||||
dur_str = dur_str[2:]
|
||||
if dur_str.startswith("0"):
|
||||
dur_str = dur_str[1:]
|
||||
try:
|
||||
dur_str = str(timedelta(seconds=float(duration_text)))[:-7]
|
||||
if dur_str.startswith("0:"):
|
||||
dur_str = dur_str[2:]
|
||||
if dur_str.startswith("0"):
|
||||
dur_str = dur_str[1:]
|
||||
except OverflowError:
|
||||
dur_str = "-:--"
|
||||
stats_label_text += f"{dur_str}"
|
||||
|
||||
if font_family:
|
||||
|
||||
Reference in New Issue
Block a user