1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-27 10:16:47 +00:00

Merge pull request #3349 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-04-01 17:25:19 -06:00 committed by GitHub
commit 19e8d596f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -96,8 +96,12 @@ class DiscoverController extends Controller
})
->values();
} else {
if($page != 1) {
$res['tags'] = [];
return $res;
}
$key = 'discover:tags:public_feed:' . $hashtag->id . ':page:' . $page;
$tags = Cache::remember($key, 900, function() use($hashtag, $page, $end) {
$tags = Cache::remember($key, 43200, function() use($hashtag, $page, $end) {
return collect(StatusHashtagService::get($hashtag->id, $page, $end))
->filter(function($tag) {
if(!$tag['status']['local']) {

View file

@ -47,7 +47,7 @@ class CustomEmoji extends Model
return [
'shortcode' => $match,
'url' => $url,
'static_path' => $url,
'static_url' => $url,
'visible_in_picker' => $tag->disabled == false
];
}
@ -57,7 +57,7 @@ class CustomEmoji extends Model
if($activitypub == true) {
return $tag && isset($tag['icon']);
} else {
return $tag && isset($tag['static_path']);
return $tag && isset($tag['static_url']);
}
})
->values()

View file

@ -118,7 +118,7 @@ class CustomEmojiService
return [
'shortcode' => str_replace(':', '', $emojo->shortcode),
'url' => $url,
'static_path' => $url,
'static_url' => $url,
'visible_in_picker' => $emojo->disabled == false
];
})

View file

@ -26,7 +26,6 @@ class StatusHashtagService {
return StatusHashtag::whereHashtagId($id)
->whereStatusVisibility('public')
->whereHas('media')
->skip($stop)
->latest()
->take(9)
@ -35,7 +34,10 @@ class StatusHashtagService {
return self::getStatus($i, $id);
})
->filter(function ($i) use($filtered) {
return isset($i['status']) && !empty($i['status']) && !in_array($i['status']['account']['id'], $filtered);
return isset($i['status']) &&
!empty($i['status']) && !in_array($i['status']['account']['id'], $filtered) &&
isset($i['status']['media_attachments']) &&
!empty($i['status']['media_attachments']);
})
->values();
}