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".
This commit is contained in:
Sam Atkins 2023-07-18 19:35:59 +01:00 committed by Sam Atkins
parent 7b4630932b
commit f25adbd5ae
Notes: sideshowbarker 2024-07-16 19:17:47 +09:00

View file

@ -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<String> PlaylistModel::column_name(int column) const