Tracker announce & scrape improvements 🥳 (#901)

* Tracker announce & scrape improvements

* Fixed null variables

Co-Authored-By: Constantine Kovalensky <45331093+kovalensky@users.noreply.github.com>

* Hybrid topics handling in announcer

* Updated

* Use correct data types

* Revert "Use correct data types"

This reverts commit bc9f0e4d6f.

* Update announce.php

* Showing downloaded times in stats

* Updated

* Updated

* Debugging variables

* Update scrape.php

* Updated

* Update announce.php

* Update announce.php

* Code re-formatting

* Code re-formatting

* Updated

* Update config.php

* Update tr_make_snapshot.php

* Update tr_complete_count.php

* Stopped event should be handled before cache check

* Include torrent download name in magnet link

* Magnet name re-formatting

* Smart cache management

---------

Co-authored-by: Constantine Kovalensky <45331093+kovalensky@users.noreply.github.com>
This commit is contained in:
Roman Kelesidis 2023-09-14 08:38:07 +07:00 committed by GitHub
commit c654a9ae36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 125 additions and 86 deletions

View file

@ -13,6 +13,18 @@ if (!defined('BB_ROOT')) {
global $bb_cfg;
// Update TORRENT "completed" counters
DB()->query("
UPDATE
" . BB_BT_TORRENTS . " tor,
" . BB_BT_TRACKER_SNAP . " snap
SET
tor.complete_count = snap.completed
WHERE
tor.topic_id = snap.topic_id
");
/*
if ($bb_cfg['ocelot']['enabled']) {
// Update TORRENT "completed" counters
DB()->query("
@ -51,4 +63,4 @@ if ($bb_cfg['ocelot']['enabled']) {
// Drop tmp table
DB()->query("DROP TEMPORARY TABLE tmp_complete_count");
}
}*/

View file

@ -41,7 +41,7 @@ while (true) {
$sql = "
SELECT
topic_id, SUM(seeder) AS seeders, (COUNT(*) - SUM(seeder)) AS leechers,
SUM(speed_up) AS speed_up, SUM(speed_down) AS speed_down
SUM(speed_up) AS speed_up, SUM(speed_down) AS speed_down, SUM(complete) AS completed
FROM " . BB_BT_TRACKER . "
WHERE topic_id BETWEEN $start_id AND $end_id
GROUP BY topic_id
@ -64,7 +64,7 @@ while (true) {
if (!$bb_cfg['ocelot']['enabled']) {
DB()->query("
REPLACE INTO " . NEW_BB_BT_TRACKER_SNAP . "
(topic_id, seeders, leechers, speed_up, speed_down)
(topic_id, seeders, leechers, speed_up, speed_down, completed)
VALUES(" . implode('),(', $val) . ")
");
} else {