[gnome-music] grilo: skip changes if mimeType cannot be determined



commit bd3f1f76ff07f08425758c1e6775a32f0de5a5ec
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Mon May 12 13:15:05 2014 +0200

    grilo: skip changes if mimeType cannot be determined

 gnomemusic/grilo.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index 62a6f85..69b4e04 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -100,7 +100,7 @@ class Grilo(GObject.GObject):
                     query = "select DISTINCT rdf:type nie:mimeType(?urn) as mime-type" +\
                             " { ?urn rdf:type nie:InformationElement . FILTER (tracker:id(?urn) = %s) }" % 
media_id
                     mimeType = grilo.tracker.query_sync(query, [Grl.METADATA_KEY_MIME], 
grilo.options)[0].get_mime()
-                    if mimeType.startswith("audio"):
+                    if mimeType and mimeType.startswith("audio"):
                         self.changed_media_ids.append(media_id)
                 if changeType == Grl.SourceChangeType.REMOVED:
                     # There is no way to check that removed item is a media


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