MPRIS OpenUri fails due to incorrect device_name #705
Labels
bug
A functionality or parts of a program that do not work as intended
good first issue
An easy to implement issue, good for first time contributors or people new to open source
help wanted
Issues that need help since the assigned person has little to no knowledge about the topic
pinned
Apply to make stale bot ignore issue/PR.
reproducibility: easy
An issue that is easily reproduced
Description
When I run
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotifyd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:https://open.spotify.com/track/5OmIZhbwxGD1BwozQJe0t8?si=0pSNgfWySnqWPp8pf5MWTQ"
, spotifyd logs show that it receives and handles the OpenUri call. However, when I debug, I see thatdevice_name
of the current device is different than what the Spotify web API returns. Where Spotify web API returns an@
character, the local spotifyd config encodes that as%40d
(e.g.Spotifyd@hostname
vsSpotifyd%40dhostname
). This prevents any device from being selected on the following line:spotifyd/src/dbus_mpris.rs
Line 340 in 133a119
This is especially problematic because the default
device_name
has an@
.To Reproduce
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotifyd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:https://open.spotify.com/track/5OmIZhbwxGD1BwozQJe0t8?si=0pSNgfWySnqWPp8pf5MWTQ"
Expected behavior
Song should play after that
dbus-send
command.Logs
The entire log was way too long to include so I just included a snippet where you can see the MPRIS call.
Click to show logs
``` event Readable Token(33554437) loop process - 1 events, 0.000s event Readable Token(33554437) D-Bus i/o poll ready: 59 is Ready(Readable) D-Bus i/o unix ready: 59 is Readable | Aio loop process - 1 events, 0.000s event Readable Token(33554437) loop process - 1 events, 0.000s handle_msgs: (MethodCall, Some("/org/mpris/MediaPlayer2"), Some("org.mpris.MediaPlayer2.Player"), Some("OpenUri")) loop poll - 29.283066ms loop time - Instant { tv_sec: 5545, tv_nsec: 23818785 } loop process, 11.562µs Polling message stream msgstream found Ok(Ready(Some((MethodCall, Some("/org/mpris/MediaPlayer2"), Some("org.mpris.MediaPlayer2.Player"), Some("OpenUri"))))) Polling message stream msgstream found Ok(NotReady) D-Bus i/o poll ready: 59 is Ready(Readable) D-Bus i/o unix ready: 59 is Readable | Aio scheduling Read for: 5 loop poll - 71.173µs loop time - Instant { tv_sec: 5545, tv_nsec: 24148965 } loop process, 9.779µs take? ("https", api.spotify.com): expiration = Some(90s) reuse idle connection for ("https", api.spotify.com) Client::encode method=GET, body=None flushed 398 bytes flushed({role=client}): State { reading: Init, writing: KeepAlive, keep_alive: Busy } event Readable | Writable Token(29360132) loop process - 1 events, 0.000s attempting to decode a frame frame decoded from buffer attempting to decode a frame frame decoded from buffer ```Compilation flags
Versions (please complete the following information):
I think it's really only possible to see the error when debugging. I might be able to create a PR to fix this but I don't really know rust. I'm sure someone that knows rust could fix this easily.
The text was updated successfully, but these errors were encountered: