mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 05:13:54 -07:00
Fixed null seeders & leechers in announcer (#891)
This commit is contained in:
parent
f4fc5d7cdf
commit
813fff63d0
2 changed files with 5 additions and 5 deletions
|
@ -207,7 +207,7 @@ if ($lp_info) {
|
||||||
$row = DB()->fetch_row($sql);
|
$row = DB()->fetch_row($sql);
|
||||||
|
|
||||||
if (empty($row['topic_id'])) {
|
if (empty($row['topic_id'])) {
|
||||||
msg_die('Torrent not registered, info_hash = ' . bin2hex($info_hash_sql));
|
msg_die('Torrent not registered, info_hash = ' . bin2hex($info_hash));
|
||||||
}
|
}
|
||||||
if (empty($row['user_id'])) {
|
if (empty($row['user_id'])) {
|
||||||
msg_die('Please LOG IN and REDOWNLOAD this torrent (user not found)');
|
msg_die('Please LOG IN and REDOWNLOAD this torrent (user not found)');
|
||||||
|
@ -408,16 +408,16 @@ if (!$output) {
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
");
|
");
|
||||||
|
|
||||||
$seeders = $row['seeders'];
|
$seeders = $row['seeders'] ?? 0;
|
||||||
$leechers = $row['leechers'];
|
$leechers = $row['leechers'] ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = [
|
$output = [
|
||||||
'interval' => (int)$announce_interval,
|
'interval' => (int)$announce_interval,
|
||||||
'min interval' => (int)$announce_interval,
|
'min interval' => (int)$announce_interval,
|
||||||
'peers' => $peers,
|
|
||||||
'complete' => (int)$seeders,
|
'complete' => (int)$seeders,
|
||||||
'incomplete' => (int)$leechers,
|
'incomplete' => (int)$leechers,
|
||||||
|
'peers' => $peers,
|
||||||
];
|
];
|
||||||
|
|
||||||
$peers_list_cached = 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);
|
||||||
|
|
|
@ -68,7 +68,7 @@ $row = DB()->fetch_row("
|
||||||
");
|
");
|
||||||
|
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
msg_die('Torrent not registered, info_hash = ' . bin2hex($info_hash_sql));
|
msg_die('Torrent not registered, info_hash = ' . bin2hex($info_hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
$output['files'][$info_hash] = [
|
$output['files'][$info_hash] = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue