Update banshee current track when necessary. Defective by design but working. Fixes #2229
This commit is contained in:
parent
bd7bac578f
commit
24f8305b81
|
@ -220,6 +220,23 @@ class MusicTrackListener(gobject.GObject):
|
|||
self._last_playing_music = info
|
||||
return info
|
||||
|
||||
## Check Banshee playing track
|
||||
test = False
|
||||
if hasattr(bus, 'name_has_owner'):
|
||||
if bus.name_has_owner('org.bansheeproject.Banshee'):
|
||||
test = True
|
||||
elif dbus.dbus_bindings.bus_name_has_owner(bus.get_connection(),
|
||||
'org.bansheeproject.Banshee'):
|
||||
test = True
|
||||
if test:
|
||||
banshee = bus.get_object('org.bansheeproject.Banshee',
|
||||
'/org/bansheeproject/Banshee/PlayerEngine')
|
||||
currentTrack = banshee.GetCurrentTrack()
|
||||
if currentTrack:
|
||||
song = self._banshee_properties_extract(currentTrack)
|
||||
self._last_playing_music = song
|
||||
return song
|
||||
|
||||
return None
|
||||
|
||||
# here we test :)
|
||||
|
|
|
@ -3285,8 +3285,8 @@ class RosterWindow:
|
|||
act = widget.get_active()
|
||||
gajim.config.set_per('accounts', account, 'publish_tune', act)
|
||||
if act:
|
||||
if not self.music_track_changed_signal:
|
||||
listener = MusicTrackListener.get()
|
||||
if not self.music_track_changed_signal:
|
||||
self.music_track_changed_signal = listener.connect(
|
||||
'music-track-changed', self.music_track_changed)
|
||||
track = listener.get_playing_track()
|
||||
|
|
Loading…
Reference in New Issue