From 77a76370a595b8b3943ff3c8d2d64d04e004d9aa Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 12 Feb 2019 23:24:16 +0100 Subject: [PATCH] Returning flat representation for artist and renamed 'name' attribute for consistency with the mpd backend --- platypush/backend/music/mopidy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/backend/music/mopidy.py b/platypush/backend/music/mopidy.py index 2901c1873..17df76ba7 100644 --- a/platypush/backend/music/mopidy.py +++ b/platypush/backend/music/mopidy.py @@ -57,9 +57,13 @@ class MusicMopidyBackend(Backend): del conv_track['uri'] if 'artists' in conv_track: - conv_track['artist'] = conv_track['artists'][0] + conv_track['artist'] = conv_track['artists'][0].get('name') del conv_track['artists'] + if 'name' in conv_track: + conv_track['title'] = conv_track['name'] + del conv_track['name'] + if 'album' in conv_track: conv_track['album'] = conv_track['album']['name']