Skip to content

Commit

Permalink
Collapsed if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
imashnake0 committed Jan 9, 2024
1 parent 1110341 commit f65bac1
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,19 +423,14 @@ fun MediaTrailer(
ImageRequest.Builder(context)
.data(bestThumbnail)
.apply {
if (bestThumbnail?.contains("maxresdefault") == true) {
listener(
onError = { _, _ ->
bestThumbnail = trailer.thumbnail.sdDefault
}
)
} else {
listener(
onError = { _, _ ->
bestThumbnail = trailer.thumbnail.defaultThumbnail
}
)
}
listener(
onError = { _, _ ->
bestThumbnail = if (bestThumbnail?.contains("maxresdefault") == true) {
trailer.thumbnail.sdDefault
} else trailer.thumbnail.defaultThumbnail
Log.d("bestThumbnail", bestThumbnail.toString())
}
)
}
.crossfade(Constants.CROSSFADE_DURATION)
.build()
Expand Down

0 comments on commit f65bac1

Please sign in to comment.