Merge pull request #4167 from pixelfed/staging

Update ApiV1Controller, add Redis facade
pull/4171/head
daniel 2 years ago committed by GitHub
commit 4a1cbb8051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,6 +9,7 @@ use App\Util\ActivityPub\Helpers;
use App\Util\Media\Filter; use App\Util\Media\Filter;
use Laravel\Passport\Passport; use Laravel\Passport\Passport;
use Auth, Cache, DB, Storage, URL; use Auth, Cache, DB, Storage, URL;
use Illuminate\Support\Facades\Redis;
use App\{ use App\{
Avatar, Avatar,
Bookmark, Bookmark,

@ -472,9 +472,9 @@ class PublicApiController extends Controller
// $types = ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album', 'text']; // $types = ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album', 'text'];
$textOnlyReplies = false; $textOnlyReplies = false;
$textOnlyReplies = (bool) Redis::zscore('pf:tl:replies', $pid);
if(config('exp.top')) { if(config('exp.top')) {
$textOnlyReplies = (bool) Redis::zscore('pf:tl:replies', $pid);
$textOnlyPosts = (bool) Redis::zscore('pf:tl:top', $pid); $textOnlyPosts = (bool) Redis::zscore('pf:tl:top', $pid);
if($textOnlyPosts) { if($textOnlyPosts) {

Loading…
Cancel
Save