From dda9e77024d0558af90d5ecfef73019282a81c8e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 10 Feb 2023 06:14:51 -0700 Subject: [PATCH] Update ApiV1Controller, add Redis facade --- app/Http/Controllers/Api/ApiV1Controller.php | 1 + app/Http/Controllers/PublicApiController.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 4447d0753..5030fd842 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -9,6 +9,7 @@ use App\Util\ActivityPub\Helpers; use App\Util\Media\Filter; use Laravel\Passport\Passport; use Auth, Cache, DB, Storage, URL; +use Illuminate\Support\Facades\Redis; use App\{ Avatar, Bookmark, diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 5aabb6c99..678100158 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -472,9 +472,9 @@ class PublicApiController extends Controller // $types = ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album', 'text']; $textOnlyReplies = false; - $textOnlyReplies = (bool) Redis::zscore('pf:tl:replies', $pid); if(config('exp.top')) { + $textOnlyReplies = (bool) Redis::zscore('pf:tl:replies', $pid); $textOnlyPosts = (bool) Redis::zscore('pf:tl:top', $pid); if($textOnlyPosts) {