mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
Merge pull request #4169 from Roardom/profile-client-seedsize
(Add) Client torrent size sum to profile page
This commit is contained in:
@@ -94,8 +94,14 @@ class UserController extends Controller
|
||||
// 'boughtDownload' => BonTransactions::where('sender_id', '=', $user->id)->where([['name', 'like', '%Download%']])->sum('cost'),
|
||||
'invitedBy' => Invite::where('accepted_by', '=', $user->id)->first(),
|
||||
'clients' => $user->peers()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->select('agent', 'port')
|
||||
->selectRaw('INET6_NTOA(ip) as ip, MIN(created_at) as created_at, MAX(updated_at) as updated_at, COUNT(*) as num_peers, MAX(connectable) as connectable')
|
||||
->selectRaw('INET6_NTOA(peers.ip) as ip')
|
||||
->selectRaw('MIN(peers.created_at) as created_at')
|
||||
->selectRaw('MAX(peers.updated_at) as updated_at')
|
||||
->selectRaw('SUM(torrents.size) as size')
|
||||
->selectRaw('COUNT(*) as num_peers')
|
||||
->selectRaw('MAX(peers.connectable) as connectable')
|
||||
->groupBy(['ip', 'port', 'agent'])
|
||||
->where('active', '=', true)
|
||||
->get(),
|
||||
|
||||
@@ -256,6 +256,7 @@
|
||||
<th>{{ __('torrent.started') }}</th>
|
||||
<th>{{ __('torrent.last-update') }}</th>
|
||||
<th>{{ __('torrent.peers') }}</th>
|
||||
<th>{{ __('torrent.size') }}</th>
|
||||
@if (\config('announce.connectable_check') === true)
|
||||
<th>Connectable</th>
|
||||
@endif
|
||||
@@ -300,6 +301,9 @@
|
||||
{{ $client->num_peers }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ App\Helpers\StringHelper::formatBytes($client->size) }}
|
||||
</td>
|
||||
@if (\config('announce.connectable_check') == true)
|
||||
@php
|
||||
$connectable = false;
|
||||
|
||||
Reference in New Issue
Block a user