summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nephilim/mpclient.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nephilim/mpclient.py b/nephilim/mpclient.py
index 8badbcb..5263ccd 100644
--- a/nephilim/mpclient.py
+++ b/nephilim/mpclient.py
@@ -109,6 +109,7 @@ class MPClient(QtCore.QObject):
db_updated = Signal()
time_changed = Signal(int)
song_changed = Signal(object)
+ songpos_changed = Signal(object) # this one's emitted when only current song's position changed
state_changed = Signal(str)
volume_changed = Signal(int)
repeat_changed = Signal(bool)
@@ -460,6 +461,7 @@ class MPClient(QtCore.QObject):
pass
if 'playlist' in subsystems:
self.playlist_changed.emit()
+ self._command('currentsong', callback = self._update_cur_song)
if 'output' in subsystems:
self._command('outputs', callback = self._update_outputs)
@@ -508,11 +510,15 @@ class MPClient(QtCore.QObject):
self._command('currentsong', callback = self._update_cur_song)
def _update_cur_song(self, data):
+ song = self.cur_song
try:
self.cur_song = Song(list(self._parse_objects(data, ''))[0])
except IndexError:
self.cur_song = Song()
- self.song_changed.emit(self.cur_song)
+ if song['id'] != self.cur_song['id']:
+ self.song_changed.emit(self.cur_song)
+ else:
+ self.songpos_changed.emit(self.cur_song)
def _command(self, *cmd, **kwargs):
"""