From 7fb3525ec709993a7525f457809e58aa7ad2135f Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 16 Dec 2021 11:10:10 +0900 Subject: [PATCH] Fix get current_song_pos in shared When polling for the shared data, the position of the song now accounts for when the position was polled (using an Instant object set to "now()" on poll, and returning the position with the Instant's elapsed time). --- src/mpd_handler.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mpd_handler.rs b/src/mpd_handler.rs index f97f10e..b2bac32 100644 --- a/src/mpd_handler.rs +++ b/src/mpd_handler.rs @@ -296,7 +296,8 @@ impl MPDHandler { title: read_lock.current_song_title.clone(), artist: read_lock.current_song_artist.clone(), length: read_lock.current_song_length, - pos: read_lock.current_song_position, + pos: read_lock.current_song_position + + read_lock.song_pos_get_time.elapsed().as_secs_f64(), error_text: read_lock.error_text.clone(), }); } -- 2.49.0