summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/dashboard/Media.qml9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index a7cda85..ba0c8f3 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -26,7 +26,14 @@ Item {
function lengthStr(length: int): string {
if (length < 0)
return "-1:-1";
- return `${Math.floor(length / 60)}:${Math.floor(length % 60).toString().padStart(2, "0")}`;
+
+ const hours = Math.floor(length / 3600);
+ const mins = Math.floor((length % 3600) / 60);
+ const secs = Math.floor(length % 60).toString().padStart(2, "0");
+
+ if (hours > 0)
+ return `${hours}:${mins.toString().padStart(2, "0")}:${secs}`;
+ return `${mins}:${secs}`;
}
implicitWidth: cover.implicitWidth + Config.dashboard.sizes.mediaVisualiserSize * 2 + details.implicitWidth + details.anchors.leftMargin + bongocat.implicitWidth + bongocat.anchors.leftMargin * 2 + Appearance.padding.large * 2