Skip to content

Commit

Permalink
announce add hr log
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Sep 14, 2023
1 parent e82530c commit 39446ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions public/announce.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,14 @@
//not set yet
$includeRate = 1;
}
$hrLog = sprintf("user: %d, torrent: %d, includeRate: %s", $userid, $torrentid, $includeRate);
$includeHr = false;
if ($includeRate >= 1 && $event == "completed") {
$includeHr = true;
$hrLog .= "includeRate >= 1 and event = completed, includeHr = true";
} elseif ($includeRate < 1 && $includeRate >= 0 && $seeder == "no" && ($left <= $torrent['size'] * (1 - $includeRate))) {
$includeHr = true;
$hrLog .= "seeder = no and left lte enough, includeHr = true";
}
if ($includeHr) {
$hrMode = \App\Models\HitAndRun::getConfig('mode', $torrent['mode']);
Expand Down

0 comments on commit 39446ae

Please sign in to comment.