[gnome-music] grilo: trap exceptions for removed media



commit 49e9f68bb4faf304fa1b3aadb424c3dba90c64b2
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Thu Mar 5 14:22:10 2015 +0100

    grilo: trap exceptions for removed media

 gnomemusic/grilo.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index cf06535..ec76e1b 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -114,7 +114,10 @@ class Grilo(GObject.GObject):
                         # There is no way to check that removed item is a media
                         # so always do the refresh
                         # todo: remove one single url
-                        self.changed_media_ids.append(media.get_id())
+                        try:
+                            self.changed_media_ids.append(media.get_id())
+                        except Exception as e:
+                            logger.warn("Skipping %s" % media)
 
                 if self.changed_media_ids == []:
                     return


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