From 699385b61369a3a900301598f2b5a23e208b4fe4 Mon Sep 17 00:00:00 2001 From: Kristian Klette Date: Wed, 30 Jun 2010 20:40:20 +0200 Subject: [PATCH 1/2] Support list album artist "someartist" --- mopidy/mpd/frontend.py | 6 +++--- tests/mpd/frontend_test.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index 58699a5b..99c449d2 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -642,8 +642,8 @@ class MpdFrontend(object): @handle_pattern(r'^list (?P[Aa]rtist)$') @handle_pattern(r'^list "(?P[Aa]rtist)"$') - @handle_pattern(r'^list (?Palbum)( "(?P[^"]+)")*$') - @handle_pattern(r'^list "(?Palbum)"( "(?P[^"]+)")*$') + @handle_pattern(r'^list (?Palbum( artist)?)( "(?P[^"]+)")*$') + @handle_pattern(r'^list "(?Palbum(" "artist)?)"( "(?P[^"]+)")*$') def _music_db_list(self, field, artist=None): """ *musicpd.org, music database section:* @@ -669,7 +669,7 @@ class MpdFrontend(object): - capitalizes the field argument. """ field = field.lower() - # TODO + pass # TODO @handle_pattern(r'^listall "(?P[^"]+)"') def _music_db_listall(self, uri): diff --git a/tests/mpd/frontend_test.py b/tests/mpd/frontend_test.py index 932d6d9a..10950ccb 100644 --- a/tests/mpd/frontend_test.py +++ b/tests/mpd/frontend_test.py @@ -1017,6 +1017,10 @@ class MusicDatabaseHandlerTest(unittest.TestCase): def test_list_album_with_artist(self): result = self.h.handle_request(u'list "album" "anartist"') self.assert_(u'OK' in result) + + def test_list_album_artist_with_artist_without_quotes(self): + result = self.h.handle_request(u'list album artist "anartist"') + self.assert_(u'OK' in result) def test_listall(self): result = self.h.handle_request(u'listall "file:///dev/urandom"') From 61ac0e5e01cc131c5c8114db07e3fc4cd508c0ea Mon Sep 17 00:00:00 2001 From: Kristian Klette Date: Wed, 30 Jun 2010 20:40:57 +0200 Subject: [PATCH 2/2] Add example for list album artist "someartist" to doc --- mopidy/mpd/frontend.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index 99c449d2..db0e7183 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -663,6 +663,14 @@ class MpdFrontend(object): list album artist "an artist name" + returns the albums available for the asked artist:: + + list album artist "Tiesto" + Album: Radio Trance Vol 4-Promo-CD + Album: Ur A Tear in the Open CDR + Album: Simple Trance 2004 Step One + Album: In Concert 05-10-2003 + *ncmpc:* - does not add quotes around the field argument.