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.
This commit is contained in:
wn_ 2023-02-03 01:02:38 +00:00
parent f0f7a5f958
commit 380624a484
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}