spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

make `Seek` and `SetPosition` functions spec compliant

Open eladyn opened this issue 3 years ago • 5 comments

This makes some MPRIS methods more spec compliant. @wasamasa does this resolve all your issues?

I'm not sure, if the integer type casting is overly cautious the way it is currently.

Fixes #1112.

eladyn avatar Sep 08 '22 23:09 eladyn

I'd like confirmation from @wasamasa that this fixes their issue before merging this, but the code looks fine.

slondr avatar Sep 11 '22 02:09 slondr

Thanks, I've tested the PR and it removes the need for all hacks in my script used to control spotifyd. I had a bit of trouble figuring out the correct syntax for the path for SetPosition to work.

wasamasa avatar Sep 11 '22 07:09 wasamasa

I missed one spot, where we incorrectly returned a time in milliseconds as Position, instead of microseconds. Now, position updates are consistent with the rest (and the spec) as well.

eladyn avatar Sep 14 '22 15:09 eladyn

Looks good!

grafik

I’m seeing one last bug. Might be that it’s a KDE plasma bug though. I hope I can describe the bug correctly.

So first what works:

  1. the seek position advances
  2. clicking the seek bar works and resets to the correct position in the track

Now to the bug:

  1. When I have the spotify desktop app open as well, I have two MPRIS players.
  2. Initially, switching from “Spotify” (desktop app) to “spotifyd” resets the seek position in the MPRIS interface to 0 ← this is a bug
  3. That changes after seeking in the MPRIS interface for “spotifyd”. The seek position seems healed: after switching between MPRIS interfaces and coming back to “spotifyd”, the seek position is correct.
  4. But it seems that after healing this one, now the “Spotify” MPRIS interface is broken ← I feel like that implies it might be a Plasma bug

flying-sheep avatar Sep 15 '22 08:09 flying-sheep

@flying-sheep Thanks for testing this PR! Since, what you describe happens as well with other MPRIS implementations, it seems indeed likely that this is rather a buggy client-side implementation than us implementing the server-side wrong. Maybe you can report that bug in the plasma repo, and we'll see what comes out of it.

eladyn avatar Sep 16 '22 21:09 eladyn