From 7ee59518c274ed417719791767fcbd2e014214e0 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 29 Apr 2023 15:54:58 +0800 Subject: [PATCH] announce think about paid torrent enabled --- public/announce.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/announce.php b/public/announce.php index b4f91e55..2a5428d5 100644 --- a/public/announce.php +++ b/public/announce.php @@ -151,9 +151,16 @@ if ($torrent['approval_status'] != \App\Models\Torrent::APPROVAL_STATUS_ALLOW && err("torrent review not approved"); } } -if ($seeder == 'no' && isset($torrent['price']) && $torrent['price'] > 0 && $torrent['owner'] != $userid) { +if ( + $seeder == 'no' + && isset($az['seedbonus']) + && isset($torrent['price']) + && $torrent['price'] > 0 + && $torrent['owner'] != $userid + && get_setting("torrent.paid_torrent_enabled") == "yes") +{ $hasBuy = \App\Models\TorrentBuyLog::query()->where('uid', $userid)->where('torrent_id', $torrent['id'])->exists(); - if (!$hasBuy && isset($az['seedbonus'])) { + if (!$hasBuy) { if ($az['seedbonus'] < $torrent['price']) { err("Not enough bonus to buy this paid torrent"); }