mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-22 12:44:25 +00:00
add magnet urn link #25
This commit is contained in:
parent
31bed20b4b
commit
51ee02201a
@ -631,6 +631,11 @@ class TorrentController extends AbstractController
|
||||
$locales = $request->get('locales') ? explode('|', $request->get('locales')) : explode('|', $this->getParameter('app.locales'));
|
||||
$sensitive = $request->get('sensitive') ? (bool) $request->get('sensitive') : null;
|
||||
|
||||
$yggdrasil = $request->get('yggdrasil') ? (bool) $request->get('yggdrasil') : false;
|
||||
|
||||
// Init trackers
|
||||
$trackers = explode('|', $this->getParameter('app.trackers'));
|
||||
|
||||
// Get total torrents
|
||||
$total = $torrentService->findTorrentsTotal(
|
||||
$query,
|
||||
@ -698,7 +703,16 @@ class TorrentController extends AbstractController
|
||||
'torrentId' => $torrent->getId()
|
||||
],
|
||||
false
|
||||
)
|
||||
),
|
||||
'urn' => $yggdrasil ? $file->setAnnounceList([$trackers])->getMagnetLink()
|
||||
: $file->setAnnounceList(
|
||||
array_unique(
|
||||
array_merge(
|
||||
$file->getAnnounceList(),
|
||||
[$trackers]
|
||||
)
|
||||
)
|
||||
)->getMagnetLink()
|
||||
],
|
||||
'scrape' =>
|
||||
[
|
||||
|
Loading…
x
Reference in New Issue
Block a user