[gnome-music/wip/jfelder/mpris-cleanup: 7/17] mpris: Cleanup SetPosition method



commit 21574495e91191b82496f85f1e88fa2f9f2fe389
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Sep 4 19:05:30 2018 +0200

    mpris: Cleanup SetPosition method

 gnomemusic/mpris.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 0b66bc70..4c947297 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -627,7 +627,9 @@ class MPRIS(DBusInterface):
         :param str track_id: The currently playing track's identifier
         :param int position_msecond: new position in microseconds
         """
-        if track_id != self._get_metadata().get('mpris:trackid').get_string():
+        metadata = self._get_metadata()
+        current_track_id = metadata["mpris:trackid"].get_string()
+        if track_id != current_track_id:
             return
         self.player.set_position(position_msecond / 1e6)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]