update: hide 'flush ghost peers' button when external tracker is enabled

The button doesn't do anything anyways for the external trackers. Users have to just wait it out.
This commit is contained in:
Roardom
2025-02-16 19:09:12 +00:00
parent cff21fe31d
commit 58ff976f12
4 changed files with 40 additions and 27 deletions
@@ -45,6 +45,10 @@ class FlushController extends Controller
*/
public function peers(): \Illuminate\Http\RedirectResponse
{
if (config('announce.external_tracker.is_enabled')) {
return redirect()->back()->withErrors("The external tracker doesn't support flushing peers.");
}
$carbon = new Carbon();
$peers = Peer::select(['torrent_id', 'user_id', 'peer_id', 'updated_at'])->where('updated_at', '<', $carbon->copy()->subHours(2))->get();