From 08cfbbc2eaf6e74780dd7196efcc15ea6d2e7d12 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 28 Jan 2023 00:43:02 +0000 Subject: [PATCH] fix(music): unable to go to prev with mpris --- src/clients/music/mpris.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/clients/music/mpris.rs b/src/clients/music/mpris.rs index af7aeef..80c4ca3 100644 --- a/src/clients/music/mpris.rs +++ b/src/clients/music/mpris.rs @@ -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(),