mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Show the last seeder's username in topics (#1051)
This commit is contained in:
parent
bf0c681ca4
commit
d7ce42f6be
5 changed files with 17 additions and 11 deletions
|
@ -54,13 +54,14 @@ if ($bb_cfg['tracker']['update_dlstat']) {
|
|||
|
||||
// Update last seeder info in BUF
|
||||
DB()->query("
|
||||
REPLACE INTO " . BUF_LAST_SEEDER . "
|
||||
(topic_id, seeder_last_seen)
|
||||
SELECT
|
||||
topic_id, " . TIMENOW . "
|
||||
FROM " . BB_BT_TRACKER . "
|
||||
WHERE seeder = 1
|
||||
GROUP BY topic_id
|
||||
REPLACE INTO " . BUF_LAST_SEEDER . "
|
||||
(topic_id, user_id, seeder_last_seen)
|
||||
SELECT
|
||||
topic_id, user_id, " . TIMENOW . "
|
||||
FROM " . BB_BT_TRACKER . "
|
||||
WHERE seeder = 1
|
||||
GROUP BY topic_id, user_id
|
||||
ORDER BY update_time DESC
|
||||
");
|
||||
|
||||
// Clean peers table
|
||||
|
|
|
@ -16,7 +16,8 @@ DB()->query("
|
|||
" . BUF_LAST_SEEDER . " b,
|
||||
" . BB_BT_TORRENTS . " tor
|
||||
SET
|
||||
tor.seeder_last_seen = b.seeder_last_seen
|
||||
tor.seeder_last_seen = b.seeder_last_seen,
|
||||
tor.last_seeder_id = b.user_id
|
||||
WHERE
|
||||
tor.topic_id = b.topic_id
|
||||
");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue