feat(mpris): Emit Seeked signal

* Add Seeked signal to Mpris interface

The Mpris2 spec includes a `Seeked` signal which should be fired when
the track position changes in an unexpected way i.e. when the user
seeks to a different part of the track.

This PR implements this signal on seek events and also when a new track
begins. The latter is not strictly required but has been observed in
other players (e.g. VLC).

Closes #1492

* chore: Use `send_mpris()` and `Duration` for conversion

* doc: Update CHANGELOG

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
elParaguayo
2024-09-21 10:55:10 +01:00
committed by GitHub
parent 3893a0ef6d
commit 40644e1de1
4 changed files with 35 additions and 0 deletions

View File

@@ -313,6 +313,10 @@ impl Queue {
move || send_notification(&summary_txt, &body_txt, cover_url)
});
}
// Send a Seeked signal at start of new track
#[cfg(feature = "mpris")]
self.spotify.notify_seeked(0);
}
if reshuffle && self.get_shuffle() {