For #25209: Avoid trying to download wallpapers without a server URL.

pull/543/head
Arturo Mejia 2 years ago committed by mergify[bot]
parent c1d7d0b29c
commit 9a27030f87

@ -34,6 +34,10 @@ class WallpaperDownloader(
* <WALLPAPER_URL>/<resolution>/<orientation>/<app theme>/<wallpaper theme>/<wallpaper name>.png
*/
suspend fun downloadWallpaper(wallpaper: Wallpaper.Remote) = withContext(Dispatchers.IO) {
if (remoteHost.isNullOrEmpty()) {
return@withContext
}
for (metadata in wallpaper.toMetadata(context)) {
val localFile = File(context.filesDir.absolutePath, metadata.localPath)
if (localFile.exists()) continue

Loading…
Cancel
Save