mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
commit
f33422e758
3 changed files with 146 additions and 125 deletions
|
@ -59,6 +59,7 @@
|
||||||
- Updated reply blade view, fix missing avatar and media images. ([5fb33772](https://github.com/pixelfed/pixelfed/commit/5fb33772))
|
- Updated reply blade view, fix missing avatar and media images. ([5fb33772](https://github.com/pixelfed/pixelfed/commit/5fb33772))
|
||||||
- Updated components, add fallback default avatar. ([726553f5](https://github.com/pixelfed/pixelfed/commit/726553f5))
|
- Updated components, add fallback default avatar. ([726553f5](https://github.com/pixelfed/pixelfed/commit/726553f5))
|
||||||
- Updated job queue, separate deletes into their own queue. ([7f421392](https://github.com/pixelfed/pixelfed/commit/7f421392))
|
- Updated job queue, separate deletes into their own queue. ([7f421392](https://github.com/pixelfed/pixelfed/commit/7f421392))
|
||||||
|
- Updated DiscoverController, use UserFilterService on trendingApi. ([135474ae](https://github.com/pixelfed/pixelfed/commit/135474ae))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0)
|
## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0)
|
||||||
|
|
|
@ -24,6 +24,7 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||||
use App\Services\StatusHashtagService;
|
use App\Services\StatusHashtagService;
|
||||||
use App\Services\SnowflakeService;
|
use App\Services\SnowflakeService;
|
||||||
use App\Services\StatusService;
|
use App\Services\StatusService;
|
||||||
|
use App\Services\UserFilterService;
|
||||||
|
|
||||||
class DiscoverController extends Controller
|
class DiscoverController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -149,16 +150,35 @@ class DiscoverController extends Controller
|
||||||
->pluck('id');
|
->pluck('id');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$filtered = Auth::check() ? UserFilterService::filters(Auth::user()->profile_id) : [];
|
||||||
|
|
||||||
$res = $ids->map(function($s) {
|
$res = $ids->map(function($s) {
|
||||||
return StatusService::get($s);
|
return StatusService::get($s);
|
||||||
});
|
})->filter(function($s) use($filtered) {
|
||||||
|
return $s && !in_array($s['account']['id'], $filtered);
|
||||||
|
})->values();
|
||||||
|
|
||||||
return response()->json($res);
|
return response()->json($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function trendingHashtags(Request $request)
|
public function trendingHashtags(Request $request)
|
||||||
{
|
{
|
||||||
return [];
|
$res = StatusHashtag::select('hashtag_id', \DB::raw('count(*) as total'))
|
||||||
|
->groupBy('hashtag_id')
|
||||||
|
->orderBy('total','desc')
|
||||||
|
->where('created_at', '>', now()->subDays(90))
|
||||||
|
->take(9)
|
||||||
|
->get()
|
||||||
|
->map(function($h) {
|
||||||
|
$hashtag = $h->hashtag;
|
||||||
|
return [
|
||||||
|
'id' => $hashtag->id,
|
||||||
|
'total' => $h->total,
|
||||||
|
'name' => '#'.$hashtag->name,
|
||||||
|
'url' => $hashtag->url('?src=dsh1')
|
||||||
|
];
|
||||||
|
});
|
||||||
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function trendingPlaces(Request $request)
|
public function trendingPlaces(Request $request)
|
||||||
|
|
|
@ -54,7 +54,7 @@ class UserFilterService {
|
||||||
|
|
||||||
public static function filters(int $profile_id) : array
|
public static function filters(int $profile_id) : array
|
||||||
{
|
{
|
||||||
return array_merge(self::mutes($profile_id), self::blocks($profile_id));
|
return array_unique(array_merge(self::mutes($profile_id), self::blocks($profile_id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function mute(int $profile_id, int $muted_id)
|
public static function mute(int $profile_id, int $muted_id)
|
||||||
|
|
Loading…
Reference in a new issue