+MPD_sima v0.12.3 UNRELEASED
+
+ * Use albumartist to fetch similar artists
+
+-- kaliko jack <kaliko@azylum.org> UNRELEASED
+
+
MPD_sima v0.12.2
* Add some randomness to track selection
def get_artist(self):
"""Get artist object from track"""
- return Artist(name=self.artist, mbid=self.musicbrainz_artistid)
+ return Artist(name=self.albumartist or self.artist,
+ mbid=self.musicbrainz_artistid)
# VIM MODLINE
# vim: ai ts=4 sw=4 sts=4 expandtab
if not self.player.playlist:
return []
tolookfor = self.player.playlist[-1].get_artist()
- self.log.info('Looking for artist similar '
- 'to "{0.artist}"'.format(self.player.playlist[-1]))
+ self.log.info('Looking for artist similar to "{}"'.format(tolookfor))
similar = self.ws_similar_artists(tolookfor)
if not similar:
self.log.info('Got nothing from {0}!'.format(self.ws.name))
def test_boolean_type(self):
self.assertFalse(bool(Track()))
+ def test_albumartist(self):
+ trk = Track(albumartist='album_artist', artist='track_artist')
+ self.assertEqual(trk.artist.name, 'album_artist')
+ trk = Track(artist='track_artist')
+ self.assertEqual(trk.artist.name, 'track_artist')
+
# vim: ai ts=4 sw=4 sts=4 expandtab