Commits

Luke Plant committed 62b8e62

Improved correctness of MPRIS2 support w.r.t getting name of player

  • Participants
  • Parent commits ddae67b

Comments (0)

Files changed (1)

playerdo/backends/mpris2.py

 
 
 PLAYER_OBJECT_NAME = "/org/mpris/MediaPlayer2"
+MAIN_INTERFACE_NAME = "org.mpris.MediaPlayer2"
 PLAYER_INTERFACE_NAME = "org.mpris.MediaPlayer2.Player"
 
 def get_sorted_candidate_buses():
         try:
             l = get_sorted_candidate_buses()
             names = []
+
             for n in l:
                 try:
-                    bus = DBusObject(n, "/")
-                    names.append(bus.Identity())
+                    props = DBusProperties(n, PLAYER_OBJECT_NAME, MAIN_INTERFACE_NAME)
+                    names.append(props.get("Identity"))
                 except:
                     pass