From 0085ca64162a37104fc031677a8b59bf7a84090c Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 2 May 2023 21:45:07 +0200 Subject: [PATCH] Fix loading images from db even if disabled --- .../java/org/schabi/newpipe/util/image/PicassoHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java b/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java index fb0c97fe1..904776580 100644 --- a/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java @@ -202,7 +202,10 @@ public final class PicassoHelper { private static RequestCreator loadImageDefault(@Nullable final String url, final int placeholderResId, final boolean showPlaceholderWhileLoading) { - if (isNullOrEmpty(url)) { + // if the URL was chosen with `choosePreferredImage` it will be null, but check again + // `shouldLoadImages` in case the URL was chosen with `imageListToDbUrl` (which is the case + // for URLs stored in the database) + if (isNullOrEmpty(url) || !ImageStrategy.shouldLoadImages()) { return picassoInstance .load((String) null) .placeholder(placeholderResId) // show placeholder when no image should load