use of com.kabouzeid.gramophone.model.Album in project Phonograph by kabouzeid.
the class ArtistGlideRequest method createBaseRequest.
public static DrawableTypeRequest createBaseRequest(RequestManager requestManager, Artist artist, boolean noCustomImage) {
boolean hasCustomImage = CustomArtistImageUtil.getInstance(App.getInstance()).hasCustomArtistImage(artist);
if (noCustomImage || !hasCustomImage) {
final List<AlbumCover> songs = new ArrayList<>();
for (final Album album : artist.albums) {
final Song song = album.safeGetFirstSong();
songs.add(new AlbumCover(album.getYear(), song.data));
}
return requestManager.load(new ArtistImage(artist.getName(), songs));
} else {
return requestManager.load(CustomArtistImageUtil.getFile(artist));
}
}
use of com.kabouzeid.gramophone.model.Album in project Phonograph by kabouzeid.
the class AlbumLoader method getOrCreateAlbum.
private static Album getOrCreateAlbum(List<Album> albums, long albumId) {
for (Album album : albums) {
if (!album.songs.isEmpty() && album.songs.get(0).albumId == albumId) {
return album;
}
}
Album album = new Album();
albums.add(album);
return album;
}
Aggregations