Fixed announcer-list issue (#1131)

* Fixed announcer-list issue

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-11-20 00:16:54 +07:00 committed by GitHub
commit 105ea911c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 10 deletions

View file

@ -5,7 +5,7 @@
**Merged pull requests:**
- Fixed announcer-list issue [\#1129](https://github.com/torrentpier/torrentpier/pull/1129), [\#1130](https://github.com/torrentpier/torrentpier/pull/1130) ([belomaxorka](https://github.com/belomaxorka))
- Fixed announcer-list issue [\#1129](https://github.com/torrentpier/torrentpier/pull/1129), [\#1130](https://github.com/torrentpier/torrentpier/pull/1130), [\#1131](https://github.com/torrentpier/torrentpier/pull/1131) ([belomaxorka](https://github.com/belomaxorka))
- Removed client column from bb_bt_tracker table [\#1128](https://github.com/torrentpier/torrentpier/pull/1128) ([belomaxorka](https://github.com/belomaxorka))
- Removed one-time used variables [\#1120](https://github.com/torrentpier/torrentpier/pull/1120) ([belomaxorka](https://github.com/belomaxorka))
- Don't create empty announce-list dict, if ann_urls are empty [\#1119](https://github.com/torrentpier/torrentpier/pull/1119) ([kovalensky](https://github.com/kovalensky))

View file

@ -574,15 +574,6 @@ class Torrent
}
unset($additional_announce_urls);
// Adding tracker announcer to announce-list
if ($bb_cfg['bt_replace_ann_url']) {
// Adding tracker announcer as main announcer (At start)
array_unshift($tor['announce-list'], [$announce_url]);
} else {
// Adding tracker announcer (At end)
$tor['announce-list'] = array_merge($tor['announce-list'], [[$announce_url]]);
}
// Adding additional announce urls (If present)
if (!empty($announce_urls_add)) {
$tor['announce-list'] = array_merge($tor['announce-list'], $announce_urls_add);
@ -595,6 +586,27 @@ class Torrent
}
}
// Adding tracker announcer to announce-list
if (!empty($tor['announce-list'])) {
if ($bb_cfg['bt_replace_ann_url']) {
// Adding tracker announcer as main announcer (At start)
array_unshift($tor['announce-list'], [$announce_url]);
} else {
// Adding torrent announcer (At start)
array_unshift($tor['announce-list'], [$tor['announce']]);
// Adding tracker announcer (At end)
if ($tor['announce'] != $announce_url) {
$tor['announce-list'] = array_merge($tor['announce-list'], [[$announce_url]]);
}
}
}
// Remove announce-list if empty
if (empty($tor['announce-list'])) {
unset($tor['announce-list']);
}
// Add publisher & topic url
$publisher_name = $bb_cfg['server_name'];
$publisher_url = make_url(TOPIC_URL . $topic_id);