From c4ab40ddb01b140e2515c875dd8d505b3d2a82dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Enrique=20Garc=C3=ADa=20Dab=C3=B3?= Date: Tue, 19 Jul 2022 12:16:25 +0200 Subject: [PATCH] Ignore dbus playlist sorting order via dbus if not supported --- sublime_music/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sublime_music/app.py b/sublime_music/app.py index 131f49d..6b2e80a 100644 --- a/sublime_music/app.py +++ b/sublime_music/app.py @@ -474,10 +474,11 @@ class SublimeMusicApp(Gtk.Application): "Created": lambda p: p.created, "Modified": lambda p: p.changed, } - playlists.sort( - key=sorters.get(order, lambda p: p), - reverse=reverse_order, - ) + if order in sorters: + playlists.sort( + key=sorters.get(order, lambda p: p), + reverse=reverse_order, + ) def make_playlist_tuple(p: Playlist) -> GLib.Variant: cover_art_filename = AdapterManager.get_cover_art_uri(