From c4e930a17bc34f2b8c5e7e847b142a2395b497cc Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 25 Jun 2015 23:16:45 +0200 Subject: [PATCH] mpd: Fix 'title' to 'track' and back conversion in list cmd (cherry picked from commit 0d032a25fa8f8db60fb8c2de2cf00d145e9749a5) --- mopidy/mpd/protocol/music_db.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mopidy/mpd/protocol/music_db.py b/mopidy/mpd/protocol/music_db.py index de800f4b..1e80f2a0 100644 --- a/mopidy/mpd/protocol/music_db.py +++ b/mopidy/mpd/protocol/music_db.py @@ -32,7 +32,7 @@ _LIST_MAPPING = { 'performer': 'performer'} _LIST_NAME_MAPPING = { - 'title': 'Title', + 'track': 'Title', 'album': 'Album', 'albumartist': 'AlbumArtist', 'artist': 'Artist', @@ -260,9 +260,10 @@ def list_(context, *args): params = list(args) if not params: raise exceptions.MpdArgError('incorrect arguments') - field = params.pop(0).lower() - if field not in _LIST_MAPPING: + field = params.pop(0).lower() + field = _LIST_MAPPING.get(field) + if field is None: raise exceptions.MpdArgError('incorrect arguments') if len(params) == 1: