[gnome-music/wip/mschraal/minor-cleanups: 1/2] coredisc: Add callback error check



commit e7a37b4c76ce94588eb6bbc1c905fa7ce1b0515a
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Jun 12 14:38:00 2020 +0200

    coredisc: Add callback error check
    
    Use meaningful argument names as well.

 gnomemusic/coredisc.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/coredisc.py b/gnomemusic/coredisc.py
index de421750..4307f0ed 100644
--- a/gnomemusic/coredisc.py
+++ b/gnomemusic/coredisc.py
@@ -45,6 +45,7 @@ class CoreDisc(GObject.GObject):
         self._coregrilo = application.props.coregrilo
         self._coremodel = application.props.coremodel
         self._filter_model = None
+        self._log = application.props.log
         self._model = None
         self._old_album_ids = []
         self._selected = False
@@ -91,7 +92,11 @@ class CoreDisc(GObject.GObject):
         def _filter_func(core_song):
             return core_song.props.grlid in album_ids
 
-        def _callback(source, dunno, media, something, something2):
+        def _callback(source, op_id, media, remaining, error):
+            if error:
+                self._log.warning("Error: {}".format(error))
+                return
+
             if media is None:
                 if sorted(album_ids) == sorted(self._old_album_ids):
                     return


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