mpd: Add album date to 'fake' tracks

This commit is contained in:
Stein Magnus Jodal 2012-12-22 02:12:07 +01:00
parent 5060db48f2
commit 04be75ed97
2 changed files with 6 additions and 2 deletions

View File

@ -27,8 +27,9 @@ def _album_as_track(album):
return Track(
uri=album.uri,
name='Album: ' + album.name,
artists=album.artists,
album=album,
artists=album.artists)
date=album.date)
def _artist_as_track(artist):

View File

@ -117,7 +117,7 @@ class MusicDatabaseHandlerTest(protocol.BaseTestCase):
class MusicDatabaseFindTest(protocol.BaseTestCase):
def test_find(self):
self.backend.library.dummy_find_exact_result = SearchResult(
albums=[Album(uri='dummy:album:a', name='A')],
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')])
@ -125,8 +125,11 @@ class MusicDatabaseFindTest(protocol.BaseTestCase):
self.assertInResponse('file: dummy:album:a')
self.assertInResponse('Title: Album: A')
self.assertInResponse('Date: 2001')
self.assertInResponse('file: dummy:artist:b')
self.assertInResponse('Title: Artist: B')
self.assertInResponse('file: dummy:track:c')
self.assertInResponse('Title: C')