mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Don't create empty announce-list dict, if ann_urls are empty (#1119)
* Improve code for retracker addition * Don't create empty announce-list dict, if ann_urls are empty
This commit is contained in:
parent
787d4ae90b
commit
ce06937aa8
1 changed files with 2 additions and 2 deletions
|
@ -568,14 +568,14 @@ class Torrent
|
||||||
// Delete all additional urls
|
// Delete all additional urls
|
||||||
if ($bb_cfg['bt_del_addit_ann_urls'] || $bb_cfg['bt_disable_dht']) {
|
if ($bb_cfg['bt_del_addit_ann_urls'] || $bb_cfg['bt_disable_dht']) {
|
||||||
unset($tor['announce-list']);
|
unset($tor['announce-list']);
|
||||||
} else {
|
} elseif (!empty($announce_urls_add)) {
|
||||||
$tor['announce-list'] = array_merge($tor['announce-list'] ?? [], $announce_urls_add);
|
$tor['announce-list'] = array_merge($tor['announce-list'] ?? [], $announce_urls_add);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add retracker
|
// Add retracker
|
||||||
if (!empty($bb_cfg['tracker']['retracker_host']) && $bb_cfg['tracker']['retracker']) {
|
if (!empty($bb_cfg['tracker']['retracker_host']) && $bb_cfg['tracker']['retracker']) {
|
||||||
if (bf($userdata['user_opt'], 'user_opt', 'user_retracker') || IS_GUEST) {
|
if (bf($userdata['user_opt'], 'user_opt', 'user_retracker') || IS_GUEST) {
|
||||||
$tor['announce-list'] = array_merge($tor['announce-list'] ?? [], [$bb_cfg['tracker']['retracker_host']]);
|
$tor['announce-list'] = array_merge($tor['announce-list'] ?? [], [[$bb_cfg['tracker']['retracker_host']]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue