[gnome-music/wip/jfelder/mpris-cleanup: 20/32] mpris: Cleanup SetPosition method



commit bdda58e8f58f80a218c3430381b919f0cea96cc4
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 88b86df7..7a679ba8 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]