mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-27 14:00:32 -05:00
update: peerlist generation
This commit is contained in:
@@ -451,7 +451,12 @@ class AnnounceController extends Controller
|
||||
$limit = ($queries['numwant'] <= 50 ? $queries['numwant'] : 50);
|
||||
|
||||
// Get Torrents Peers
|
||||
$peers = Peer::where('torrent_id', '=', $torrent->id)->where('user_id', '!=', $user->id)->take($limit)->get()->toArray();
|
||||
if ($queries['left'] == 0) {
|
||||
// Only include leechers in a seeder's peerlist
|
||||
$peers = Peer::where('torrent_id', '=', $torrent->id)->where('seeder', '=', 0)->where('user_id', '!=', $user->id)->take($limit)->get()->toArray();
|
||||
} else {
|
||||
$peers = Peer::where('torrent_id', '=', $torrent->id)->where('user_id', '!=', $user->id)->take($limit)->get()->toArray();
|
||||
}
|
||||
|
||||
$repDict['peers'] = $this->givePeers($peers, $queries['compact'], $queries['no_peer_id']);
|
||||
$repDict['peers6'] = $this->givePeers($peers, $queries['compact'], $queries['no_peer_id'], FILTER_FLAG_IPV6);
|
||||
|
||||
Reference in New Issue
Block a user