1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

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
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

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(),