Use cached album art when available
This commit is contained in:
parent
caa3e549e7
commit
dbf547f549
1 changed files with 8 additions and 2 deletions
|
@ -224,8 +224,14 @@ fun Context.getAlbumCoverArt(album: Album, callback: (coverArt: Any?) -> Unit) {
|
|||
|
||||
fun Context.getGenreCoverArt(genre: Genre, callback: (coverArt: Any?) -> Unit) {
|
||||
ensureBackgroundThread {
|
||||
val track = audioHelper.getGenreTracks(genre.id).firstOrNull()
|
||||
getTrackCoverArt(track, callback)
|
||||
if (genre.albumArt.isEmpty()) {
|
||||
val track = audioHelper.getGenreTracks(genre.id).firstOrNull()
|
||||
getTrackCoverArt(track, callback)
|
||||
} else {
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
callback(genre.albumArt)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue