mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Code formatting (#1056)
This commit is contained in:
parent
ad031e3bc3
commit
6e0a9964f0
2 changed files with 6 additions and 7 deletions
|
@ -394,11 +394,11 @@ if (!$output) {
|
|||
$peers6 = '';
|
||||
|
||||
foreach ($rowset as $peer) {
|
||||
if (!empty($peer['ip'])){
|
||||
if (!empty($peer['ip'])) {
|
||||
$peer_ipv4 = \TorrentPier\Helpers\IPHelper::long2ip_extended($peer['ip']);
|
||||
$peers .= inet_pton($peer_ipv4) . pack('n', $peer['port']);
|
||||
}
|
||||
if (!empty($peer['ipv6'])){
|
||||
if (!empty($peer['ipv6'])) {
|
||||
$peer_ipv6 = \TorrentPier\Helpers\IPHelper::long2ip_extended($peer['ipv6']);
|
||||
$peers6 .= inet_pton($peer_ipv6) . pack('n', $peer['port']);
|
||||
}
|
||||
|
@ -407,11 +407,11 @@ if (!$output) {
|
|||
$peers = [];
|
||||
|
||||
foreach ($rowset as $peer) {
|
||||
if (!empty($peer['ip'])){
|
||||
if (!empty($peer['ip'])) {
|
||||
$peer_ipv4 = \TorrentPier\Helpers\IPHelper::long2ip_extended($peer['ip']);
|
||||
$peers[] = ['ip' => \TorrentPier\Helpers\IPHelper::long2ip_extended($peer['ip']), 'port' => (int)$peer['port']];
|
||||
}
|
||||
if (!empty($peer['ipv6'])){
|
||||
if (!empty($peer['ipv6'])) {
|
||||
$peer_ipv6 = \TorrentPier\Helpers\IPHelper::long2ip_extended($peer['ipv6']);
|
||||
$peers[] = ['ip' => \TorrentPier\Helpers\IPHelper::long2ip_extended($peer['ipv6']), 'port' => (int)$peer['port']];
|
||||
}
|
||||
|
|
|
@ -44,8 +44,7 @@ foreach ($info_hash_array[1] as $hash) {
|
|||
|
||||
if ($scrape_cache = CACHE('tr_cache')->get(SCRAPE_LIST_PREFIX . bin2hex($decoded_hash))) {
|
||||
$torrents['files'][$info_key = array_key_first($scrape_cache)] = $scrape_cache[$info_key];
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$info_hashes[] = DB()->escape(($decoded_hash));
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +54,7 @@ $info_hash_count = count($info_hashes);
|
|||
if (!empty($info_hash_count)) {
|
||||
|
||||
if ($info_hash_count > $bb_cfg['max_scrapes']) {
|
||||
$info_hashes = array_slice($info_hashes, 0, $bb_cfg['max_scrapes']);
|
||||
$info_hashes = array_slice($info_hashes, 0, $bb_cfg['max_scrapes']);
|
||||
}
|
||||
|
||||
$info_hashes_sql = implode('\', \'', $info_hashes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue