GSConnect / gnome-shell-extension-gsconnect

KDE Connect implementation for GNOME
GNU General Public License v2.0
3.17k stars 254 forks source link

Fix MPRIS seeking and SetPosition #1783

Closed ferdnyc closed 5 months ago

ferdnyc commented 5 months ago

Correct the math we use to perform seek operations via MPRIS, since KDEConnect uses microseconds for seek offsets even though they use milliseconds for position values. (MPRIS uses microseconds everywhere.)

Also, implement SetPosition() directly instead of computing the offset from the current position and calling Seek(), because some players don't respect arbitrary Seek() lengths.

Picking up the currently-playing trackid at the time the SetPosition() call is handled and assuming it's the same track it was intended for is somewhat risky, but picking up the current Position and making the same assumption (which is what the previous code did) carried the exact same amount of risk.

Fixes: #1779

ferdnyc commented 5 months ago

Might as well get this one in too, before we start making release noises.