diff --git a/mopidy/frontends/mpd/protocol/music_db.py b/mopidy/frontends/mpd/protocol/music_db.py index 0d84171c..c2035b15 100644 --- a/mopidy/frontends/mpd/protocol/music_db.py +++ b/mopidy/frontends/mpd/protocol/music_db.py @@ -106,7 +106,7 @@ def find(context, mpd_query): 'composer' not in query and 'performer' not in query): result_tracks += [_artist_as_track(a) for a in _get_artists(results)] - if 'album' not in query and 'genre' not in query: + if 'album' not in query: result_tracks += [_album_as_track(a) for a in _get_albums(results)] result_tracks += _get_tracks(results) return translator.tracks_to_mpd_format(result_tracks) diff --git a/mopidy/models.py b/mopidy/models.py index 5ab2ed92..04d71591 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -219,10 +219,10 @@ class Track(ImmutableObject): :type artists: list of :class:`Artist` :param album: track album :type album: :class:`Album` - :param composer: track composer - :type composer: string - :param performer: track performer - :type performer: string + :param composers: track composers + :type composers: string + :param performers: track performers + :type performers: string :param genre: track genre :type genre: string :param track_no: track number in album diff --git a/tests/backends/local/library_test.py b/tests/backends/local/library_test.py index 39980fcc..c38fd74f 100644 --- a/tests/backends/local/library_test.py +++ b/tests/backends/local/library_test.py @@ -48,8 +48,7 @@ class LocalLibraryProviderTest(unittest.TestCase): uri='local:track:path4', name='track4', artists=[artists[2]], album=albums[3], date='2004', length=60000, track_no=4, - comment='Music server with support for MPD/HTTP clients ' - 'and Spotify streaming http://www.mopidy.com'), + comment='This is a fantastic track'), Track( uri='local:track:path5', name='track5', genre='genre1', album=albums[3], length=4000, composers=[artists[4]]), @@ -242,12 +241,11 @@ class LocalLibraryProviderTest(unittest.TestCase): def test_find_exact_comment(self): result = self.library.find_exact( - comment=['Music server with support for MPD/HTTP clients ' - 'and Spotify streaming http://www.mopidy.com']) + comment=['This is a fantastic track']) self.assertEqual(list(result[0].tracks), self.tracks[3:4]) result = self.library.find_exact( - comment=['Music server with support for MPD/HTTP clients']) + comment=['This is a fantastic']) self.assertEqual(list(result[0].tracks), []) def test_find_exact_any(self): @@ -295,8 +293,7 @@ class LocalLibraryProviderTest(unittest.TestCase): # Matches on track comment result = self.library.find_exact( - any=['Music server with support for MPD/HTTP clients ' - 'and Spotify streaming http://www.mopidy.com']) + any=['This is a fantastic track']) self.assertEqual(list(result[0].tracks), self.tracks[3:4]) # Matches on URI @@ -458,10 +455,10 @@ class LocalLibraryProviderTest(unittest.TestCase): self.assertEqual(list(result[0].tracks), self.tracks[1:2]) def test_search_comment(self): - result = self.library.search(comment=['mopidy']) + result = self.library.search(comment=['fantastic']) self.assertEqual(list(result[0].tracks), self.tracks[3:4]) - result = self.library.search(comment=['Potify']) + result = self.library.search(comment=['antasti']) self.assertEqual(list(result[0].tracks), self.tracks[3:4]) def test_search_any(self): @@ -501,10 +498,10 @@ class LocalLibraryProviderTest(unittest.TestCase): self.assertEqual(list(result[0].tracks), self.tracks[5:6]) # Matches on track comment - result = self.library.search(any=['http']) + result = self.library.search(any=['fanta']) self.assertEqual(list(result[0].tracks), self.tracks[3:4]) - result = self.library.search(any=['streaming']) + result = self.library.search(any=['is a fan']) self.assertEqual(list(result[0].tracks), self.tracks[3:4]) # Matches on URI diff --git a/tests/data/library_tag_cache b/tests/data/library_tag_cache index fb89a26d..6d00cf97 100644 --- a/tests/data/library_tag_cache +++ b/tests/data/library_tag_cache @@ -37,7 +37,7 @@ Title: track4 Album: album4 Date: 2004 Track: 4 -Comment: Music server with support for MPD/HTTP clients and Spotify streaming http://www.mopidy.com +Comment: This is a fantastic track Time: 60 key: key5 file: /path5 diff --git a/tests/frontends/mpd/protocol/status_test.py b/tests/frontends/mpd/protocol/status_test.py index bd75efb5..1cf5f253 100644 --- a/tests/frontends/mpd/protocol/status_test.py +++ b/tests/frontends/mpd/protocol/status_test.py @@ -21,6 +21,7 @@ class StatusHandlerTest(protocol.BaseTestCase): self.assertInResponse('Title: ') self.assertInResponse('Album: ') self.assertInResponse('Track: 0') + self.assertNotInResponse('Date: ') self.assertInResponse('Pos: 0') self.assertInResponse('Id: 0') self.assertInResponse('OK') diff --git a/tests/frontends/mpd/translator_test.py b/tests/frontends/mpd/translator_test.py index 1b89c283..a1578791 100644 --- a/tests/frontends/mpd/translator_test.py +++ b/tests/frontends/mpd/translator_test.py @@ -41,6 +41,7 @@ class TrackMpdFormatTest(unittest.TestCase): self.assertIn(('Title', ''), result) self.assertIn(('Album', ''), result) self.assertIn(('Track', 0), result) + self.assertNotIn(('Date', ''), result) self.assertEqual(len(result), 6) def test_track_to_mpd_format_with_position(self):