diff options
author | wn_ <[email protected]> | 2023-02-03 01:02:38 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2023-02-03 01:02:42 +0000 |
commit | 380624a4840f99457b23ed3223f37d4d79b9d1f2 (patch) | |
tree | 73727503a54c274bb2d739ffcce12e57bfbcaf03 | |
parent | f0f7a5f9589348e27fa66b1a02e90d669bfc6874 (diff) |
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.
-rwxr-xr-x | classes/rssutils.php | 6 |
1 files changed, 4 insertions, 2 deletions
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); } } |