Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPRIS returns an empty array #649

Closed
mtshrmn opened this issue Jul 25, 2020 · 7 comments
Closed

MPRIS returns an empty array #649

mtshrmn opened this issue Jul 25, 2020 · 7 comments
Labels
bug A functionality or parts of a program that do not work as intended pinned Apply to make stale bot ignore issue/PR.

Comments

@mtshrmn
Copy link

mtshrmn commented Jul 25, 2020

Description

This is a follow up to #503
In the issue, it is instructed to use your own Spotify client id when running spotifyd.

I've followed the instructions by creating a new id and setting the SPOTIFYD_CLIENT_ID environment variable.
however, the error still persists.

To Reproduce

run: SPOTIFY_CLIENT_ID=ID spotifyd --no-daemon
(in fish that's how you set the environment variable)

Expected behavior

should not show the error

Logs

Click to show logs https://pastebin.com/AGzczd5e

I've downloaded using AUR: https://aur.archlinux.org/packages/spotifyd-dbus-mpris/

Versions (please complete the following information):

  • OS: Arch on kernel 5.7.10
  • Spotifyd: 0.2.24
  • cargo: 1.45.0
@mtshrmn mtshrmn added the bug A functionality or parts of a program that do not work as intended label Jul 25, 2020
@mainrs
Copy link
Member

mainrs commented Jul 25, 2020

The issue had a template for a reason. You didn't provide any log files or information about the system you are running.
Why do people ignore my templates... 🤦 It's like the first thing people do is to ctrl-a-delete the content 😔

@mtshrmn
Copy link
Author

mtshrmn commented Jul 25, 2020

You're right, I'm sorry, updating the issue.

@stale
Copy link

stale bot commented Jan 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issues that will not be fixed under any circumstances label Jan 13, 2021
@stale stale bot closed this as completed Jan 23, 2021
@mainrs mainrs added pinned Apply to make stale bot ignore issue/PR. and removed wontfix Issues that will not be fixed under any circumstances labels Jan 23, 2021
@mainrs mainrs reopened this Jan 23, 2021
@NNEU-1
Copy link
Contributor

NNEU-1 commented Mar 13, 2022

I just tried to make add a set method to the volume property.
In doing so, I discovered more issues on the dbus, such as the one described here.

if I try:
dbus-send --session --print-reply --dest=org.mpris.MediaPlayer2.spotifyd /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'

I get:
method return time=1647187893.258206 sender=:1.1051 -> destination=:1.1052 serial=9 reply_serial=2 variant array [ ]

@eladyn stated here #1047 that this may be because of an expired token.

I think that this is another problem, but not the main one

Because even if the token is not expired, an empty array will be returned. This seems to be the case because the response from the Spotify API is in a different format from what Rspotify expects.

Err(ErrorMessage { msg: "convert result failed, reason: Error(\"unknown variant collection, expected one of artist, album, track, playlist, user\", line: 8, column: 25); content: [\"{\\n \\\"timestamp\\\" : 1647187889280,\\n \\\"context\\\" : {\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/collection/tracks\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/me/tracks\\\",\\n \\\"type\\\" : \\\"collection\\\",\\n \\\"uri\\\" : \\\"spotify:user:<username>:collection\\\"\\n },\\n \\\"progress_ms\\\" : 74502,\\n \\\"item\\\" : {\\n \\\"album\\\" : {\\n \\\"album_type\\\" : \\\"album\\\",\\n \\\"artists\\\" : [ {\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/artist/6nS5roXSAGhTGr34W6n7Et\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/artists/6nS5roXSAGhTGr34W6n7Et\\\",\\n \\\"id\\\" : \\\"6nS5roXSAGhTGr34W6n7Et\\\",\\n \\\"name\\\" : \\\"Disclosure\\\",\\n \\\"type\\\" : \\\"artist\\\",\\n \\\"uri\\\" : \\\"spotify:artist:6nS5roXSAGhTGr34W6n7Et\\\"\\n } ],\\n \\\"available_markets\\\" : [ \\\"AD\\\", \\\"AE\\\", \\\"AG\\\", \\\"AL\\\", \\\"AM\\\", \\\"AO\\\", \\\"AR\\\", \\\"AT\\\", \\\"AU\\\", \\\"AZ\\\", \\\"BA\\\", \\\"BB\\\", \\\"BD\\\", \\\"BE\\\", \\\"BF\\\", \\\"BG\\\", \\\"BH\\\", \\\"BI\\\", \\\"BJ\\\", \\\"BN\\\", \\\"BO\\\", \\\"BR\\\", \\\"BS\\\", \\\"BT\\\", \\\"BW\\\", \\\"BY\\\", \\\"BZ\\\", \\\"CD\\\", \\\"CG\\\", \\\"CH\\\", \\\"CI\\\", \\\"CL\\\", \\\"CM\\\", \\\"CO\\\", \\\"CR\\\", \\\"CV\\\", \\\"CW\\\", \\\"CY\\\", \\\"CZ\\\", \\\"DE\\\", \\\"DJ\\\", \\\"DK\\\", \\\"DM\\\", \\\"DO\\\", \\\"DZ\\\", \\\"EC\\\", \\\"EE\\\", \\\"EG\\\", \\\"ES\\\", \\\"FI\\\", \\\"FJ\\\", \\\"FM\\\", \\\"FR\\\", \\\"GA\\\", \\\"GB\\\", \\\"GD\\\", \\\"GE\\\", \\\"GH\\\", \\\"GM\\\", \\\"GN\\\", \\\"GQ\\\", \\\"GR\\\", \\\"GT\\\", \\\"GW\\\", \\\"GY\\\", \\\"HK\\\", \\\"HN\\\", \\\"HR\\\", \\\"HT\\\", \\\"HU\\\", \\\"ID\\\", \\\"IE\\\", \\\"IL\\\", \\\"IN\\\", \\\"IQ\\\", \\\"IS\\\", \\\"IT\\\", \\\"JM\\\", \\\"JO\\\", \\\"JP\\\", \\\"KE\\\", \\\"KG\\\", \\\"KH\\\", \\\"KI\\\", \\\"KM\\\", \\\"KN\\\", \\\"KR\\\", \\\"KW\\\", \\\"KZ\\\", \\\"LA\\\", \\\"LB\\\", \\\"LC\\\", \\\"LI\\\", \\\"LK\\\", \\\"LR\\\", \\\"LS\\\", \\\"LT\\\", \\\"LU\\\", \\\"LV\\\", \\\"LY\\\", \\\"MA\\\", \\\"MC\\\", \\\"MD\\\", \\\"ME\\\", \\\"MG\\\", \\\"MH\\\", \\\"MK\\\", \\\"ML\\\", \\\"MN\\\", \\\"MO\\\", \\\"MR\\\", \\\"MT\\\", \\\"MU\\\", \\\"MV\\\", \\\"MW\\\", \\\"MX\\\", \\\"MY\\\", \\\"MZ\\\", \\\"NA\\\", \\\"NE\\\", \\\"NG\\\", \\\"NI\\\", \\\"NL\\\", \\\"NO\\\", \\\"NP\\\", \\\"NR\\\", \\\"NZ\\\", \\\"OM\\\", \\\"PA\\\", \\\"PE\\\", \\\"PG\\\", \\\"PH\\\", \\\"PK\\\", \\\"PL\\\", \\\"PS\\\", \\\"PT\\\", \\\"PW\\\", \\\"PY\\\", \\\"QA\\\", \\\"RO\\\", \\\"RS\\\", \\\"RU\\\", \\\"RW\\\", \\\"SA\\\", \\\"SB\\\", \\\"SC\\\", \\\"SE\\\", \\\"SG\\\", \\\"SI\\\", \\\"SK\\\", \\\"SL\\\", \\\"SM\\\", \\\"SN\\\", \\\"SR\\\", \\\"ST\\\", \\\"SV\\\", \\\"SZ\\\", \\\"TD\\\", \\\"TG\\\", \\\"TH\\\", \\\"TJ\\\", \\\"TL\\\", \\\"TN\\\", \\\"TO\\\", \\\"TR\\\", \\\"TT\\\", \\\"TV\\\", \\\"TW\\\", \\\"TZ\\\", \\\"UA\\\", \\\"UG\\\", \\\"UY\\\", \\\"UZ\\\", \\\"VC\\\", \\\"VE\\\", \\\"VN\\\", \\\"VU\\\", \\\"WS\\\", \\\"XK\\\", \\\"ZA\\\", \\\"ZM\\\", \\\"ZW\\\" ],\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/album/7bdjtx1RTkWoSoOaIl7a8E\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/albums/7bdjtx1RTkWoSoOaIl7a8E\\\",\\n \\\"id\\\" : \\\"7bdjtx1RTkWoSoOaIl7a8E\\\",\\n \\\"images\\\" : [ {\\n \\\"height\\\" : 640,\\n \\\"url\\\" : \\\"https://i.scdn.co/image/ab67616d0000b273786201dca187d2b0c956c24b\\\",\\n \\\"width\\\" : 640\\n }, {\\n \\\"height\\\" : 300,\\n \\\"url\\\" : \\\"https://i.scdn.co/image/ab67616d00001e02786201dca187d2b0c956c24b\\\",\\n \\\"width\\\" : 300\\n }, {\\n \\\"height\\\" : 64,\\n \\\"url\\\" : \\\"https://i.scdn.co/image/ab67616d00004851786201dca187d2b0c956c24b\\\",\\n \\\"width\\\" : 64\\n } ],\\n \\\"name\\\" : \\\"Settle (Special Edition)\\\",\\n \\\"release_date\\\" : \\\"2013-06-03\\\",\\n \\\"release_date_precision\\\" : \\\"day\\\",\\n \\\"total_tracks\\\" : 37,\\n \\\"type\\\" : \\\"album\\\",\\n \\\"uri\\\" : \\\"spotify:album:7bdjtx1RTkWoSoOaIl7a8E\\\"\\n },\\n \\\"artists\\\" : [ {\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/artist/6nS5roXSAGhTGr34W6n7Et\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/artists/6nS5roXSAGhTGr34W6n7Et\\\",\\n \\\"id\\\" : \\\"6nS5roXSAGhTGr34W6n7Et\\\",\\n \\\"name\\\" : \\\"Disclosure\\\",\\n \\\"type\\\" : \\\"artist\\\",\\n \\\"uri\\\" : \\\"spotify:artist:6nS5roXSAGhTGr34W6n7Et\\\"\\n }, {\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/artist/14L5rpGTLVUz1pD8fUeJB1\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/artists/14L5rpGTLVUz1pD8fUeJB1\\\",\\n \\\"id\\\" : \\\"14L5rpGTLVUz1pD8fUeJB1\\\",\\n \\\"name\\\" : \\\"Eliza Doolittle\\\",\\n \\\"type\\\" : \\\"artist\\\",\\n \\\"uri\\\" : \\\"spotify:artist:14L5rpGTLVUz1pD8fUeJB1\\\"\\n }, {\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/artist/6nxWCVXbOlEVRexSbLsTer\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/artists/6nxWCVXbOlEVRexSbLsTer\\\",\\n \\\"id\\\" : \\\"6nxWCVXbOlEVRexSbLsTer\\\",\\n \\\"name\\\" : \\\"Flume\\\",\\n \\\"type\\\" : \\\"artist\\\",\\n \\\"uri\\\" : \\\"spotify:artist:6nxWCVXbOlEVRexSbLsTer\\\"\\n } ],\\n \\\"available_markets\\\" : [ \\\"AD\\\", \\\"AE\\\", \\\"AG\\\", \\\"AL\\\", \\\"AM\\\", \\\"AO\\\", \\\"AR\\\", \\\"AT\\\", \\\"AU\\\", \\\"AZ\\\", \\\"BA\\\", \\\"BB\\\", \\\"BD\\\", \\\"BE\\\", \\\"BF\\\", \\\"BG\\\", \\\"BH\\\", \\\"BI\\\", \\\"BJ\\\", \\\"BN\\\", \\\"BO\\\", \\\"BR\\\", \\\"BS\\\", \\\"BT\\\", \\\"BW\\\", \\\"BY\\\", \\\"BZ\\\", \\\"CD\\\", \\\"CG\\\", \\\"CH\\\", \\\"CI\\\", \\\"CL\\\", \\\"CM\\\", \\\"CO\\\", \\\"CR\\\", \\\"CV\\\", \\\"CW\\\", \\\"CY\\\", \\\"CZ\\\", \\\"DE\\\", \\\"DJ\\\", \\\"DK\\\", \\\"DM\\\", \\\"DO\\\", \\\"DZ\\\", \\\"EC\\\", \\\"EE\\\", \\\"EG\\\", \\\"ES\\\", \\\"FI\\\", \\\"FJ\\\", \\\"FM\\\", \\\"FR\\\", \\\"GA\\\", \\\"GB\\\", \\\"GD\\\", \\\"GE\\\", \\\"GH\\\", \\\"GM\\\", \\\"GN\\\", \\\"GQ\\\", \\\"GR\\\", \\\"GT\\\", \\\"GW\\\", \\\"GY\\\", \\\"HK\\\", \\\"HN\\\", \\\"HR\\\", \\\"HT\\\", \\\"HU\\\", \\\"ID\\\", \\\"IE\\\", \\\"IL\\\", \\\"IN\\\", \\\"IQ\\\", \\\"IS\\\", \\\"IT\\\", \\\"JM\\\", \\\"JO\\\", \\\"JP\\\", \\\"KE\\\", \\\"KG\\\", \\\"KH\\\", \\\"KI\\\", \\\"KM\\\", \\\"KN\\\", \\\"KR\\\", \\\"KW\\\", \\\"KZ\\\", \\\"LA\\\", \\\"LB\\\", \\\"LC\\\", \\\"LI\\\", \\\"LK\\\", \\\"LR\\\", \\\"LS\\\", \\\"LT\\\", \\\"LU\\\", \\\"LV\\\", \\\"LY\\\", \\\"MA\\\", \\\"MC\\\", \\\"MD\\\", \\\"ME\\\", \\\"MG\\\", \\\"MH\\\", \\\"MK\\\", \\\"ML\\\", \\\"MN\\\", \\\"MO\\\", \\\"MR\\\", \\\"MT\\\", \\\"MU\\\", \\\"MV\\\", \\\"MW\\\", \\\"MX\\\", \\\"MY\\\", \\\"MZ\\\", \\\"NA\\\", \\\"NE\\\", \\\"NG\\\", \\\"NI\\\", \\\"NL\\\", \\\"NO\\\", \\\"NP\\\", \\\"NR\\\", \\\"NZ\\\", \\\"OM\\\", \\\"PA\\\", \\\"PE\\\", \\\"PG\\\", \\\"PH\\\", \\\"PK\\\", \\\"PL\\\", \\\"PS\\\", \\\"PT\\\", \\\"PW\\\", \\\"PY\\\", \\\"QA\\\", \\\"RO\\\", \\\"RS\\\", \\\"RU\\\", \\\"RW\\\", \\\"SA\\\", \\\"SB\\\", \\\"SC\\\", \\\"SE\\\", \\\"SG\\\", \\\"SI\\\", \\\"SK\\\", \\\"SL\\\", \\\"SM\\\", \\\"SN\\\", \\\"SR\\\", \\\"ST\\\", \\\"SV\\\", \\\"SZ\\\", \\\"TD\\\", \\\"TG\\\", \\\"TH\\\", \\\"TJ\\\", \\\"TL\\\", \\\"TN\\\", \\\"TO\\\", \\\"TR\\\", \\\"TT\\\", \\\"TV\\\", \\\"TW\\\", \\\"TZ\\\", \\\"UA\\\", \\\"UG\\\", \\\"UY\\\", \\\"UZ\\\", \\\"VC\\\", \\\"VE\\\", \\\"VN\\\", \\\"VU\\\", \\\"WS\\\", \\\"XK\\\", \\\"ZA\\\", \\\"ZM\\\", \\\"ZW\\\" ],\\n \\\"disc_number\\\" : 1,\\n \\\"duration_ms\\\" : 282812,\\n \\\"explicit\\\" : false,\\n \\\"external_ids\\\" : {\\n \\\"isrc\\\" : \\\"GBUM71303827\\\"\\n },\\n \\\"external_urls\\\" : {\\n \\\"spotify\\\" : \\\"https://open.spotify.com/track/3W2ZcrRsInZbjWylOi6KhZ\\\"\\n },\\n \\\"href\\\" : \\\"https://api.spotify.com/v1/tracks/3W2ZcrRsInZbjWylOi6KhZ\\\",\\n \\\"id\\\" : \\\"3W2ZcrRsInZbjWylOi6KhZ\\\",\\n \\\"is_local\\\" : false,\\n \\\"name\\\" : \\\"You & Me - Flume Remix\\\",\\n \\\"popularity\\\" : 76,\\n \\\"preview_url\\\" : \\\"https://p.scdn.co/mp3-preview/c05c8ea6de99d9a85b3614c0d45c47c8b9b41611?cid=2c1ea588dfbc4a989e2426f8385297c3\\\",\\n \\\"track_number\\\" : 34,\\n \\\"type\\\" : \\\"track\\\",\\n \\\"uri\\\" : \\\"spotify:track:3W2ZcrRsInZbjWylOi6KhZ\\\"\\n },\\n \\\"currently_playing_type\\\" : \\\"track\\\",\\n \\\"actions\\\" : {\\n \\\"disallows\\\" : {\\n \\\"skipping_prev\\\" : true,\\n \\\"toggling_repeat_track\\\" : true\\n }\\n },\\n \\\"is_playing\\\" : true\\n}\"]" })

Rspotify has just added this "collection" variant:
ramsayleung/rspotify#306

However, the current release of Rspotify breaks compatibility with the currently used version.

This phenomenon btw also applies to the other methods with similar implementations - such as the volume property, which always returns the default value of 0.

BTW, this issue does not affect metadata which is fetched for the properties changed notifications because it used a different method.
instead of requesting information of the currently playing track, it uses the track_id provided by librespot PlayerEvent to fetch metadata for this particular track id.

It would be great if a new version of Rspotify would be implemented.

@eladyn
Copy link
Member

eladyn commented Sep 9, 2022

So rspotify is now on the newest version, can anyone confirm or deny that this problem does no longer occur?

@bartlibert
Copy link

For me it works fine now.

@eladyn
Copy link
Member

eladyn commented Sep 9, 2022

Thanks for the feedback, going to close this. If anyone runs into this problem again, feel free to reopen!

@eladyn eladyn closed this as completed Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A functionality or parts of a program that do not work as intended pinned Apply to make stale bot ignore issue/PR.
Projects
None yet
Development

No branches or pull requests

5 participants