This commit is contained in:
Roman Kelesidis 2023-09-10 21:29:56 +07:00
commit 9a01e395d9
3 changed files with 5 additions and 5 deletions

View file

@ -396,12 +396,12 @@ if (!$output) {
'min interval' => (int)$announce_interval,
'complete' => (int)$seeders,
'incomplete' => (int)$leechers,
//'downloaded' => int($client_complete)
// TODO: 'downloaded' => (int)$client_complete,
'warning message' => 'Statistics were updated',
'peers' => $peers,
];
CACHE('tr_cache')->set(PEERS_LIST_PREFIX . $topic_id, $output, PEERS_LIST_EXPIRE);
$peers_list_cached = CACHE('tr_cache')->set(PEERS_LIST_PREFIX . $topic_id, $output, PEERS_LIST_EXPIRE);
}
// Return data to client

View file

@ -71,7 +71,7 @@ function dummy_exit($interval = 1800, $cache_dict = [])
if (!empty($cache_dict)) {
$output['complete'] = $cache_dict['complete'];
$output['incomplete'] = $cache_dict['incomplete'];
//$output['downloaded'] = $cache_dict['downloaded'];
// TODO: $output['downloaded'] = $cache_dict['downloaded'];
$output['warning message'] = 'Next statistics update in: ' . (floor($interval / 60) % 60) . ' minutes';
$output['peers'] = $cache_dict['peers'];
}

View file

@ -36,7 +36,7 @@ if (strlen($info_hash) == 32) {
} elseif (strlen($info_hash) == 20) {
$is_bt_v2 = false;
} else {
msg_die('Invalid info_hash');
msg_die('Invalid info_hash: ' . $info_hash);
}
$info_hash_hex = bin2hex($info_hash);
@ -70,7 +70,7 @@ $output['files'][$info_hash] = [
'incomplete' => (int)$row['leechers'],
];
CACHE('tr_cache')->set(SCRAPE_LIST_PREFIX . $info_hash_hex, $output, SCRAPE_LIST_EXPIRE);
$peers_list_cached = CACHE('tr_cache')->set(SCRAPE_LIST_PREFIX . $info_hash_hex, $output, SCRAPE_LIST_EXPIRE);
echo \SandFox\Bencode\Bencode::encode($output);