Add git info to nodeinfo.json

pull/922/head
Daniel Supernault 2019-03-01 20:25:41 -07:00
rodzic c212ac1ef0
commit 528261dccc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -102,7 +102,7 @@ class FederationController extends Controller
$count = $count->merge($statuses);
$profiles = Profile::select('id')->whereNull('domain')->where('created_at', '>', now()->subMonths(6)->toDateTimeString())->groupBy('id')->pluck('id')->toArray();
$count = $count->merge($profiles);
return $count->count();
return $count->unique()->count();
});
$activeMonth = Cache::remember('api:nodeinfo:am', now()->addHours(12), function() {
$count = collect([]);
@ -112,7 +112,7 @@ class FederationController extends Controller
$count = $count->merge($statuses);
$profiles = Profile::select('id')->whereNull('domain')->where('created_at', '>', now()->subMonths(1)->toDateTimeString())->groupBy('id')->pluck('id')->toArray();
$count = $count->merge($profiles);
return $count->count();
return $count->unique()->count();
});
return [
'metadata' => [
@ -140,7 +140,7 @@ class FederationController extends Controller
'localPosts' => \App\Status::whereLocal(true)->whereHas('media')->count(),
'localComments' => \App\Status::whereLocal(true)->whereNotNull('in_reply_to_id')->count(),
'users' => [
'total' => \App\User::count(),
'total' => \App\Profile::whereNull('status')->whereNull('domain')->count(),
'activeHalfyear' => $activeHalfYear,
'activeMonth' => $activeMonth,
],