mpd: Don't return fake artists when searching by albumartist
This commit is contained in:
parent
6af0ace8ac
commit
24a2b08fc5
@ -91,7 +91,7 @@ def find(context, mpd_query):
|
||||
return
|
||||
results = context.core.library.find_exact(**query).get()
|
||||
result_tracks = []
|
||||
if 'artist' not in query:
|
||||
if 'artist' not in query and 'albumartist' not in query:
|
||||
result_tracks += [_artist_as_track(a) for a in _get_artists(results)]
|
||||
if 'album' not in query:
|
||||
result_tracks += [_album_as_track(a) for a in _get_albums(results)]
|
||||
|
||||
@ -175,6 +175,26 @@ class MusicDatabaseFindTest(protocol.BaseTestCase):
|
||||
|
||||
self.assertInResponse('OK')
|
||||
|
||||
def test_find_albumartist_does_not_include_fake_artist_tracks(self):
|
||||
self.backend.library.dummy_find_exact_result = SearchResult(
|
||||
albums=[Album(uri='dummy:album:a', name='A', date='2001')],
|
||||
artists=[Artist(uri='dummy:artist:b', name='B')],
|
||||
tracks=[Track(uri='dummy:track:c', name='C')])
|
||||
|
||||
self.sendRequest('find "albumartist" "foo"')
|
||||
|
||||
self.assertNotInResponse('file: dummy:artist:b')
|
||||
self.assertNotInResponse('Title: Artist: B')
|
||||
|
||||
self.assertInResponse('file: dummy:album:a')
|
||||
self.assertInResponse('Title: Album: A')
|
||||
self.assertInResponse('Date: 2001')
|
||||
|
||||
self.assertInResponse('file: dummy:track:c')
|
||||
self.assertInResponse('Title: C')
|
||||
|
||||
self.assertInResponse('OK')
|
||||
|
||||
def test_find_artist_and_album_does_not_include_fake_tracks(self):
|
||||
self.backend.library.dummy_find_exact_result = SearchResult(
|
||||
albums=[Album(uri='dummy:album:a', name='A', date='2001')],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user