From 380624a4840f99457b23ed3223f37d4d79b9d1f2 Mon Sep 17 00:00:00 2001 From: wn_ Date: Fri, 3 Feb 2023 01:02:38 +0000 Subject: Persist failure to detect favicon average color. Previously, an empty string returned by '\Colors\calculate_avg_color()' would be set as the 'favicon_avg_color' value, resulting in always reattempting average color calculation. --- classes/rssutils.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/rssutils.php b/classes/rssutils.php index b3363954c..26e9dd033 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -633,12 +633,14 @@ class RSSUtils { $feed_obj->save(); $feed_obj->favicon_avg_color = \Colors\calculate_avg_color($favicon_cache->get_full_path($feed)); - $feed_obj->save(); + if ($feed_obj->favicon_avg_color) { + $feed_obj->save(); + } Debug::log("favicon: avg color: {$feed_obj->favicon_avg_color}", Debug::LOG_VERBOSE); } else if ($feed_obj->favicon_avg_color == 'fail') { - Debug::log("floicon failed on $feed, not trying to recalculate avg color", Debug::LOG_VERBOSE); + Debug::log("floicon failed on $feed or a suitable avg color couldn't be determined, not trying to recalculate avg color", Debug::LOG_VERBOSE); } } -- cgit v1.2.3