[gnome-music] mpris: handle an edge case in GetAll method



commit c27bb28fb23fcd463aa1acad7342e223073744d9
Author: Gaurav Narula <gnarula94 gmail com>
Date:   Sat Mar 19 01:17:57 2016 +0530

    mpris: handle an edge case in GetAll method
    
    Some clients invoke the GetAll method of org.freedesktop.DBus.Properties interface
    with the Properties and Introspectable interface as arguments which do not have
    any properties. This patch returns an empty dictionary for this scenario rather
    than raising an exception.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705069

 gnomemusic/mpris.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index c4dc859..0e38ec9 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -722,6 +722,10 @@ class MediaPlayer2Service(Server):
                 'Orderings': GLib.Variant('as', ['Alphabetical']),
                 'ActivePlaylist': GLib.Variant('(b(oss))', self._get_active_playlist()),
             }
+        elif interface_name == 'org.freedesktop.DBus.Properties':
+            return {}
+        elif interface_name == 'org.freedesktop.DBus.Introspectable':
+            return {}
         else:
             raise Exception(
                 'org.mpris.MediaPlayer2.GnomeMusic',


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