[gnome-music/wip/jfelder/3-38-remove-song-from-playlist: 2/2] grltrackerplaylists: Check for failure on song deletion




commit f009147424f4c09017c40ccf1beaa370f1cc37c5
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Feb 24 18:37:48 2021 +0100

    grltrackerplaylists: Check for failure on song deletion

 gnomemusic/grilowrappers/grltrackerplaylists.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index 26bbfa18d..e6193a7bc 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -514,8 +514,13 @@ class Playlist(GObject.GObject):
         :param CoreSong coresong: song to remove
         """
         def update_cb(conn, res):
-            # FIXME: Check for failure.
-            conn.update_finish(res)
+            try:
+                conn.update_finish(res)
+            except GLib.Error as e:
+                self._log.warning(
+                    "Unable to remove song from playlist {}: {}".format(
+                        self.props.title, e.message))
+
             self._notificationmanager.pop_loading()
 
         def entry_retrieved_cb(source, op_id, media, remaining, error):


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