diff --git a/app/Http/Controllers/AnnounceController.php b/app/Http/Controllers/AnnounceController.php index d065183045..0d4a0cb7bc 100644 --- a/app/Http/Controllers/AnnounceController.php +++ b/app/Http/Controllers/AnnounceController.php @@ -451,7 +451,12 @@ private function generateSuccessAnnounceResponse($queries, $torrent, $user): arr $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);