use of com.github.hakko.musiccabinet.domain.model.music.Album in project musiccabinet by hakko.
the class LibraryBrowserServiceTest method findsTrack.
@Test
public void findsTrack() throws Exception {
scannerService.add(set(aretha));
Artist artist = new Artist("Aretha Franklin");
int artistId = musicDao.getArtistId(artist);
List<Album> albums = browserService.getAlbums(artistId, true);
assertAlbums(albums, artist, UNKNOWN_ALBUM);
List<Track> tracks = browserService.getTracks(albums.get(0).getTrackIds());
assertTracks(tracks, Arrays.asList(new Track("Aretha Franklin", "Bridge Over Troubled Water")));
}
use of com.github.hakko.musiccabinet.domain.model.music.Album in project musiccabinet by hakko.
the class LibraryBrowserServiceTest method findsArtwork.
@Test
public void findsArtwork() throws Exception {
Artist artist = new Artist("Artist Name");
int artistId = musicDao.getArtistId(artist);
scannerService.add(set(media3));
List<Album> albums = browserService.getAlbums(artistId, true);
assertAlbums(albums, artist, "Embedded artwork", "Folder artwork");
Album folderArtAlbum = getAlbum(albums, "Folder artwork");
Album embeddedArtAlbum = getAlbum(albums, "Embedded artwork");
Assert.assertTrue(embeddedArtAlbum.getCoverArtPath() != null);
Assert.assertTrue(embeddedArtAlbum.isCoverArtEmbedded());
Assert.assertTrue(embeddedArtAlbum.getCoverArtURL() == null);
Assert.assertTrue(folderArtAlbum.getCoverArtPath() != null);
Assert.assertFalse(folderArtAlbum.isCoverArtEmbedded());
Assert.assertTrue(folderArtAlbum.getCoverArtURL() == null);
Assert.assertTrue(embeddedArtAlbum.getCoverArtPath().endsWith("Embedded artwork.mp3"));
Assert.assertTrue(folderArtAlbum.getCoverArtPath().endsWith("folder.png"));
}
Aggregations