Skip to content

Commit

Permalink
refactor: fallback to image source as thumb if none provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Oct 30, 2023
1 parent 2b27bfc commit 54b3d42
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/com/bnyro/wallpaper/api/bi/BiApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class BiApi() : Api() {
title = it.title,
url = "$baseUrl${it.quiz}",
resolution = "1920x1080",
thumb = imgUrl,
// creation date doesn't contain any dividers by default
creationDate = it.startDate
?.replaceRange(6, 6, "-")
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/bnyro/wallpaper/api/ow/OwApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class OwApi() : Api() {
0,
Wallpaper(
imgSrc = it.value.textValue(),
thumb = it.value.textValue(),
category = it.key
)
)
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/bnyro/wallpaper/api/ps/PsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class PsApi : Api() {
imgSrc = it.download_url!!,
author = it.author,
resolution = "${it.width}x${it.height}",
url = it.url,
thumb = it.download_url
url = it.url
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fun WallpaperGrid(
) {
Box {
AsyncImage(
model = it.thumb,
model = it.thumb ?: it.imgSrc,
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
Expand Down

0 comments on commit 54b3d42

Please sign in to comment.