fix(music): unable to go to prev with mpris

This commit is contained in:
Jake Stanger
2023-01-28 00:43:02 +00:00
parent e1f523cf2a
commit 08cfbbc2ea

View File

@@ -158,8 +158,10 @@ impl Client {
.unwrap_or(0);
let status = Status {
playlist_position: 0,
playlist_length: track_list.map(|list| list.len() as u32).unwrap_or(1),
// MRPIS doesn't seem to provide playlist info reliably,
// so we can just assume next/prev will work by bodging the numbers
playlist_position: 1,
playlist_length: track_list.map(|list| list.len() as u32).unwrap_or(u32::MAX),
state: PlayerState::from(playback_status),
elapsed: player.get_position().ok(),
duration: metadata.length(),