mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-01-21 11:30:46 -06:00
fix: add torrents to external tracker immediately
Otherwise, we get errors when deleting pending torrents.
This commit is contained in:
@@ -28,6 +28,7 @@ use App\Models\Tv;
|
||||
use App\Models\User;
|
||||
use App\Repositories\ChatRepository;
|
||||
use App\Services\Tmdb\TMDBScraper;
|
||||
use App\Services\Unit3dAnnounce;
|
||||
use App\Traits\TorrentMeta;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -313,6 +314,8 @@ class TorrentController extends BaseController
|
||||
// Save The Torrent
|
||||
$torrent->save();
|
||||
|
||||
Unit3dAnnounce::addTorrent($torrent);
|
||||
|
||||
// Set torrent to featured
|
||||
if ($torrent->featured == 1) {
|
||||
$featuredTorrent = new FeaturedTorrent();
|
||||
|
||||
@@ -408,6 +408,8 @@ class TorrentController extends Controller
|
||||
'moderated_by' => User::SYSTEM_USER_ID,
|
||||
] + $request->safe()->except(['torrent']));
|
||||
|
||||
Unit3dAnnounce::addTorrent($torrent);
|
||||
|
||||
// Count and save the torrent number in this category
|
||||
$category = Category::findOrFail($request->integer('category_id'));
|
||||
$category->num_torrent = $category->torrents()->count();
|
||||
|
||||
Reference in New Issue
Block a user