[gnome-music/wip/jfelder/playlist-name-escape: 1/3] grltrackerplaylists: Check for failure on playlist creation
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/playlist-name-escape: 1/3] grltrackerplaylists: Check for failure on playlist creation
- Date: Wed, 24 Feb 2021 19:04:08 +0000 (UTC)
commit 2d50d22c8f285c82bc37010e829cd36de1368c11
Author: Jean Felder <jfelder src gnome org>
Date: Wed Feb 24 19:55:39 2021 +0100
grltrackerplaylists: Check for failure on playlist creation
This prevents a crash if a playlist cannot be created.
Related: https://gitlab.gnome.org/GNOME/gnome-music/-/issues/447
gnomemusic/grilowrappers/grltrackerplaylists.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index 720c541ca..5bb235123 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -200,7 +200,18 @@ class GrlTrackerPlaylists(GObject.GObject):
:param callback: function to perform once, the playlist is created
"""
def _create_cb(conn, res, data):
- result = conn.update_blank_finish(res)
+ try:
+ result = conn.update_blank_finish(res)
+ except GLib.Error as error:
+ self._log.warning(
+ "Unable to create playlist {}: {}".format(
+ playlist_title, error.message))
+ self._notificationmanager.pop_loading()
+ if callback is not None:
+ callback(None)
+
+ return
+
playlist_urn = result[0][0]['playlist']
query = """
SELECT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]