mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Record changed port while re-announcing (#1102)
This commit is contained in:
parent
7e4a76dc02
commit
b3b659a5c3
2 changed files with 12 additions and 12 deletions
|
@ -42,6 +42,9 @@ foreach ($info_hash_array[1] as $hash) {
|
|||
|
||||
$decoded_hash = urldecode($hash);
|
||||
|
||||
if (strlen($decoded_hash) !== 20) {
|
||||
continue;
|
||||
}
|
||||
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 {
|
||||
|
@ -79,7 +82,7 @@ if (!empty($info_hash_count)) {
|
|||
foreach ($scrapes as $scrape) {
|
||||
$hash_v1 = !empty($scrape['info_hash']) ? $scrape['info_hash'] : '';
|
||||
$hash_v2 = !empty($scrape['info_hash_v2']) ? substr($scrape['info_hash_v2'], 0, 20) : '';
|
||||
$info_hash_scrape = (in_array(urlencode($hash_v2), $info_hash_array[1])) ? $hash_v2 : $hash_v1;
|
||||
$info_hash_scrape = (in_array(urlencode($hash_v1), $info_hash_array[1])) ? $hash_v1 : $hash_v2; // Replace logic to prioritize $hash_v2, in case of future prioritization of v2
|
||||
|
||||
$torrents['files'][$info_hash_scrape] = [
|
||||
'complete' => (int)$scrape['seeders'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue