diff --git a/mopidy/frontends/mpd/protocol/music_db.py b/mopidy/frontends/mpd/protocol/music_db.py index f81d57ee..49384cb0 100644 --- a/mopidy/frontends/mpd/protocol/music_db.py +++ b/mopidy/frontends/mpd/protocol/music_db.py @@ -10,8 +10,8 @@ from mopidy.frontends.mpd.protocol import handle_request, stored_playlists QUERY_RE = ( - r'(?P("?([Aa]lbum|[Aa]rtist|[Dd]ate|[Ff]ile|[Ff]ilename|' - r'[Tt]itle|[Aa]ny)"? "[^"]*"\s?)+)$') + r'(?P("?([Aa]lbum|[Aa]rtist|[Aa]lbumartist|[Dd]ate|[Ff]ile|' + r'[Ff]ilename|[Tt]itle|[Aa]ny)"? "[^"]*"\s?)+)$') def _get_field(field, search_results): diff --git a/tests/frontends/mpd/protocol/music_db_test.py b/tests/frontends/mpd/protocol/music_db_test.py index eaa5da06..47d5bb87 100644 --- a/tests/frontends/mpd/protocol/music_db_test.py +++ b/tests/frontends/mpd/protocol/music_db_test.py @@ -211,6 +211,14 @@ class MusicDatabaseFindTest(protocol.BaseTestCase): self.sendRequest('find artist "what"') self.assertInResponse('OK') + def test_find_albumartist(self): + self.sendRequest('find "albumartist" "what"') + self.assertInResponse('OK') + + def test_find_albumartist_without_quotes(self): + self.sendRequest('find albumartist "what"') + self.assertInResponse('OK') + def test_find_filename(self): self.sendRequest('find "filename" "afilename"') self.assertInResponse('OK') @@ -545,6 +553,18 @@ class MusicDatabaseSearchTest(protocol.BaseTestCase): self.sendRequest('search "artist" ""') self.assertInResponse('OK') + def test_search_albumartist(self): + self.sendRequest('search "albumartist" "analbumartist"') + self.assertInResponse('OK') + + def test_search_albumartist_without_quotes(self): + self.sendRequest('search albumartist "analbumartist"') + self.assertInResponse('OK') + + def test_search_albumartist_without_filter_value(self): + self.sendRequest('search "albumartist" ""') + self.assertInResponse('OK') + def test_search_filename(self): self.sendRequest('search "filename" "afilename"') self.assertInResponse('OK')