lastfm / lastfm-desktop

The official Last.fm desktop application suite
http://www.last.fm
GNU General Public License v3.0
461 stars 94 forks source link

Some issues with MPRIS2 #38

Open eartle opened 10 years ago

eartle commented 10 years ago

Here is an email I received about an MPRIS2 problem

had to make a couple of changes to lastfm-desktop to have the MPRIS listener working.

First, when the track changes without a state change, that is, if you click another track on a player without pausing or stopping, the state will always be "Playing" and lastfm-desktop will never see the change.

Changed Mpris2Service.cpp to always emit stateChanged( m_state ) by removing && changedProperties.value( "PlaybackStatus" ).toString() != m_state

Second, nothing was being submited because of the check track.extra("playerId" ) != "mpris2" on ScrobbleService::scrobblableTrack on ScrobbleService.cpp.

The player is rhythmbox.

With gmusicbrowser I had a weirder problem: it only sends PlaybackStatus on the properties changed when you change the playback status (compare to rhythmbox that send the actual status with every track change, for instance "Playing").

So, if you start lastfm-scrobbler with gmusicbrowser already playing you won't get to see any tracks because PlaybackStatus will never be there.

Fixed gmusicbrowser's mpris2.pm to always include the PlaybackStatus on changes. Couldn't think of a better way.