[gnome-music/wip/mschraal/glib-logging: 10/65] grlsearchwrapper: Use new logger



commit 12f3fa5df1a52a49abbc6a3e5e3995dbf796ceef
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Jan 27 19:40:30 2020 +0100

    grlsearchwrapper: Use new logger

 gnomemusic/grilowrappers/grlsearchwrapper.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grlsearchwrapper.py b/gnomemusic/grilowrappers/grlsearchwrapper.py
index 8e9a70dc..ab263e6c 100644
--- a/gnomemusic/grilowrappers/grlsearchwrapper.py
+++ b/gnomemusic/grilowrappers/grlsearchwrapper.py
@@ -70,6 +70,7 @@ class GrlSearchWrapper(GObject.GObject):
         self._coremodel = coremodel
         self._coreselection = application.props.coreselection
         self._grilo = grilo
+        self._log = application.props.log
         self._source = source
 
         self._song_search_proxy = self._coremodel.props.songs_search_proxy
@@ -97,9 +98,10 @@ class GrlSearchWrapper(GObject.GObject):
 
         def _search_result_cb(source, op_id, media, remaining, error):
             if error:
-                print("error")
+                self._log.warning("Error: {}".format(error))
                 return
-            if media is None:
+
+            if not media:
                 return
 
             coresong = CoreSong(media, self._coreselection, self._grilo)


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