[fenix] For https://github.com/mozilla-mobile/fenix/issues/25209: Avoid trying to download wallpapers without a server URL.

pull/600/head
Arturo Mejia 2 years ago committed by mergify[bot]
parent 6ce141dec2
commit 73811608f5

@ -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