mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-30 07:20:25 -05:00
fix: viewing stats from external tracker
Some incorrect logic here that was never properly tested
This commit is contained in:
@@ -34,7 +34,7 @@ class UserController extends Controller
|
||||
/**
|
||||
* Show A User.
|
||||
*/
|
||||
public function show(User $user): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
public function show(Request $request, User $user): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
{
|
||||
$user->load([
|
||||
'application',
|
||||
@@ -105,7 +105,7 @@ class UserController extends Controller
|
||||
->where('user_id', '=', $user->id)
|
||||
->first(),
|
||||
'watch' => $user->watchlist,
|
||||
'externalUser' => $user->group->is_modo ? Unit3dAnnounce::getUser($user->id) : null,
|
||||
'externalUser' => $request->user()->group->is_modo ? Unit3dAnnounce::getUser($user->id) : null,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ class Unit3dAnnounce
|
||||
&& \array_key_exists('announce_responses_per_60s', $stats) && \is_float($stats['announce_responses_per_60s'])
|
||||
&& \array_key_exists('announce_responses_per_900s', $stats) && \is_float($stats['announce_responses_per_900s'])
|
||||
&& \array_key_exists('announce_responses_per_7200s', $stats) && \is_float($stats['announce_responses_per_7200s'])
|
||||
&& \array_key_exists('announce_responses_per_second', $stats) && \is_float($stats['announce_responses_per_second'])
|
||||
) {
|
||||
return $stats;
|
||||
}
|
||||
@@ -150,10 +149,10 @@ class Unit3dAnnounce
|
||||
|| !\array_key_exists('torrent_id', $peer) || !\is_int($peer['torrent_id'])
|
||||
|| !\array_key_exists('port', $peer) || !\is_int($peer['port'])
|
||||
|| !\array_key_exists('is_seeder', $peer) || !\is_bool($peer['is_seeder'])
|
||||
|| !\array_key_exists('is_active', $peer) || \is_bool($peer['is_active'])
|
||||
|| !\array_key_exists('updated_at', $peer) || \is_int($peer['updated_at'])
|
||||
|| !\array_key_exists('uploaded', $peer) || \is_int($peer['uploaded'])
|
||||
|| !\array_key_exists('downloaded', $peer) || \is_int($peer['downloaded'])
|
||||
|| !\array_key_exists('is_active', $peer) || !\is_bool($peer['is_active'])
|
||||
|| !\array_key_exists('updated_at', $peer) || !\is_int($peer['updated_at'])
|
||||
|| !\array_key_exists('uploaded', $peer) || !\is_int($peer['uploaded'])
|
||||
|| !\array_key_exists('downloaded', $peer) || !\is_int($peer['downloaded'])
|
||||
) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user