[gnome-music/wip/jfelder/restore-mpris-playlists: 7/13] mpris: Use a correct identifier for playlists
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/restore-mpris-playlists: 7/13] mpris: Use a correct identifier for playlists
- Date: Mon, 30 Sep 2019 12:53:57 +0000 (UTC)
commit d67b9989929d878a1a1e9880831bbf1c9b8b568d
Author: Jean Felder <jfelder src gnome org>
Date: Thu Sep 26 18:16:03 2019 +0200
mpris: Use a correct identifier for playlists
According to mpris specifications: "Media players may not use any
paths starting with /org/mpris".
If the playlist is not valid, It is suggested to use "/" as the
playlist id.
gnomemusic/mpris.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 8cd51642..962465c0 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -470,13 +470,12 @@ class MPRIS(DBusInterface):
:return: a D-Bus id to uniquely identify the playlist
:rtype: str
"""
- # Smart Playlists do not have an id
- if playlist:
- pl_id = playlist.props.pl_id or playlist.props.tag_text
- else:
- pl_id = "Invalid"
+ if not playlist:
+ return "/"
- return "/org/mpris/MediaPlayer2/Playlist/{}".format(pl_id)
+ # Smart Playlists do not have an id
+ pl_id = playlist.props.pl_id or playlist.props.tag_text
+ return "/org/gnome/GnomeMusic/Playlist/{}".format(pl_id)
@log
def _get_mpris_playlist_from_playlist(self, playlist):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]