fix: wrap media position by length (#1410)

This commit is contained in:
2 * r + 2 * t 2026-04-19 20:02:50 +10:00
parent b0d5700be1
commit 31c484b041
2 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ Item {
property real playerProgress: {
const active = Players.active;
return active?.length ? active.position / active.length : 0;
return active?.length ? (active.position % active.length) / active.length : 0;
}
function lengthStr(length: int): string {
@ -354,7 +354,7 @@ Item {
anchors.left: parent.left
text: root.lengthStr(Players.active?.position ?? -1)
text: root.lengthStr(Players.active ? Players.active.position % Players.active.length : -1)
color: Colours.palette.m3onSurfaceVariant
font.pointSize: Tokens.font.size.small
}

View file

@ -11,7 +11,7 @@ Item {
property real playerProgress: {
const active = Players.active;
return active?.length ? active.position / active.length : 0;
return active?.length ? (active.position % active.length) / active.length : 0;
}
anchors.top: parent.top