[Player] Fix time display

This commit is contained in:
Janis Hutz 2025-05-05 12:01:07 +02:00
parent 2b2f1c2b66
commit ec04ebee66

View File

@ -135,8 +135,9 @@ const PlayerItem = ({ player }: { player: AstalMpris.Player }) => {
};
const secondsToFriendlyTime = (time: number) => {
const minutes = Math.floor(time / 60);
const hours = Math.floor(minutes / 60);
const m = Math.floor(time / 60);
const minutes = Math.floor(m % 60);
const hours = Math.floor(m / 60 % 24);
const seconds = Math.floor(time % 60);
if (hours > 0) {
return `${hours}:${expandTime(minutes)}:${expandTime(seconds)}`;