use of com.kabouzeid.gramophone.glide.artistimage.ArtistImage 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));
}
}
Aggregations