mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 09:17:03 +00:00
Update PublicTimelineService, improve warmCache query
This commit is contained in:
parent
cbe9458244
commit
9f901d65c9
1 changed files with 3 additions and 3 deletions
|
@ -77,12 +77,12 @@ class PublicTimelineService {
|
||||||
if(self::count() == 0 || $force == true) {
|
if(self::count() == 0 || $force == true) {
|
||||||
$hideNsfw = config('instance.hide_nsfw_on_public_feeds');
|
$hideNsfw = config('instance.hide_nsfw_on_public_feeds');
|
||||||
Redis::del(self::CACHE_KEY);
|
Redis::del(self::CACHE_KEY);
|
||||||
$ids = Status::whereNull('uri')
|
$minId = SnowflakeService::byDate(now()->subDays(14));
|
||||||
->whereNull('in_reply_to_id')
|
$ids = Status::where('id', '>', $minId)
|
||||||
|
->whereNull(['uri', 'in_reply_to_id', 'reblog_of_id'])
|
||||||
->when($hideNsfw, function($q, $hideNsfw) {
|
->when($hideNsfw, function($q, $hideNsfw) {
|
||||||
return $q->where('is_nsfw', false);
|
return $q->where('is_nsfw', false);
|
||||||
})
|
})
|
||||||
->whereNull('reblog_of_id')
|
|
||||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||||
->whereScope('public')
|
->whereScope('public')
|
||||||
->orderByDesc('id')
|
->orderByDesc('id')
|
||||||
|
|
Loading…
Reference in a new issue