Performance improvements when displaying local posts

This commit is contained in:
Michael 2024-04-17 19:16:47 +00:00
parent bae1f63424
commit c82a1ed467
16 changed files with 1101 additions and 28 deletions

View file

@ -21,6 +21,7 @@
namespace Friendica\Content\Widget;
use Friendica\Content\Conversation\Entity\Community;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\Tag;
@ -39,9 +40,9 @@ class TrendingTags
* @return string Formatted HTML code
* @throws \Exception
*/
public static function getHTML(string $content = 'global', int $period = 24): string
public static function getHTML(string $content = Community::GLOBAL, int $period = 24): string
{
if ($content == 'local') {
if ($content == Community::LOCAL) {
$tags = Tag::getLocalTrendingHashtags($period, 20);
} else {
$tags = Tag::getGlobalTrendingHashtags($period, 20);