PEP creates less traffic now and MPRIS is now more tolerant.
This commit is contained in:
parent
b7863b0316
commit
129c115837
2 changed files with 9 additions and 1 deletions
|
@ -159,6 +159,7 @@ class MusicTrackListener(gobject.GObject):
|
||||||
|
|
||||||
def _mpris_music_track_change_cb(self, arg):
|
def _mpris_music_track_change_cb(self, arg):
|
||||||
self._last_playing_music = self._mpris_properties_extract(arg)
|
self._last_playing_music = self._mpris_properties_extract(arg)
|
||||||
|
self.emit('music-track-changed', self._last_playing_music)
|
||||||
|
|
||||||
def _muine_properties_extract(self, song_string):
|
def _muine_properties_extract(self, song_string):
|
||||||
d = dict((x.strip() for x in s1.split(':', 1)) for s1 in \
|
d = dict((x.strip() for x in s1.split(':', 1)) for s1 in \
|
||||||
|
|
|
@ -1646,9 +1646,14 @@ class RosterWindow:
|
||||||
continue
|
continue
|
||||||
if not gajim.connections[account].pep_supported:
|
if not gajim.connections[account].pep_supported:
|
||||||
continue
|
continue
|
||||||
|
if self._music_track_info == music_track_info:
|
||||||
|
continue
|
||||||
pep.user_send_tune(account, artist, title, source)
|
pep.user_send_tune(account, artist, title, source)
|
||||||
|
self._music_track_info = music_track_info
|
||||||
elif gajim.connections[account].pep_supported:
|
elif gajim.connections[account].pep_supported:
|
||||||
pep.user_send_tune(account, artist, title, source)
|
if self._music_track_info != music_track_info:
|
||||||
|
pep.user_send_tune(account, artist, title, source)
|
||||||
|
self._music_track_info = music_track_info
|
||||||
|
|
||||||
|
|
||||||
def connected_rooms(self, account):
|
def connected_rooms(self, account):
|
||||||
|
@ -5767,6 +5772,8 @@ class RosterWindow:
|
||||||
# quitting
|
# quitting
|
||||||
self.quit_on_next_offline = -1
|
self.quit_on_next_offline = -1
|
||||||
|
|
||||||
|
self._music_track_info = None
|
||||||
|
|
||||||
# uf_show, img, show, sensitive
|
# uf_show, img, show, sensitive
|
||||||
liststore = gtk.ListStore(str, gtk.Image, str, bool)
|
liststore = gtk.ListStore(str, gtk.Image, str, bool)
|
||||||
self.status_combobox = self.xml.get_widget('status_combobox')
|
self.status_combobox = self.xml.get_widget('status_combobox')
|
||||||
|
|
Loading…
Add table
Reference in a new issue