From f25adbd5ae1d48a7aaab125baea62dbcb7b523c8 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 18 Jul 2023 19:35:59 +0100 Subject: [PATCH] SoundPlayer: Correct formatting of PlaylistModel duration text The previous code would format 5400 seconds as "1:90:00", when it should be "1:30:00". --- Userland/Applications/SoundPlayer/PlaylistWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp index feaeda5672..cb6a5c00b0 100644 --- a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp +++ b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp @@ -70,7 +70,7 @@ DeprecatedString PlaylistModel::format_filesize(u64 size_in_bytes) DeprecatedString PlaylistModel::format_duration(u32 duration_in_seconds) { - return DeprecatedString::formatted("{:02}:{:02}:{:02}", duration_in_seconds / 3600, duration_in_seconds / 60, duration_in_seconds % 60); + return DeprecatedString::formatted("{:02}:{:02}:{:02}", duration_in_seconds / 3600, (duration_in_seconds / 60) % 60, duration_in_seconds % 60); } ErrorOr PlaylistModel::column_name(int column) const