fix: refresh the torrent before sending to external tracker

We need to populate the status, seeders, leechers, and times_completed fields.
This commit is contained in:
Roardom
2024-04-20 01:03:27 +00:00
parent c5377ae96b
commit 11ef47ca09
2 changed files with 6 additions and 0 deletions
@@ -314,6 +314,9 @@ class TorrentController extends BaseController
// Save The Torrent
$torrent->save();
// Populate the status/seeders/leechers/times_completed fields for the external tracker
$torrent->refresh();
Unit3dAnnounce::addTorrent($torrent);
if ($torrent->featured) {
@@ -408,6 +408,9 @@ class TorrentController extends Controller
'moderated_by' => User::SYSTEM_USER_ID,
] + $request->safe()->except(['torrent']));
// Populate the status/seeders/leechers/times_completed fields for the external tracker
$torrent->refresh();
Unit3dAnnounce::addTorrent($torrent);
if ($torrent->getAttribute('featured')) {