From 4c519a56baa1ad55181544c674d2254a6b8dd8c0 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Oct 2023 04:36:12 +0300 Subject: [PATCH] add torrent / magnet download links, remove locale references #25 --- src/Controller/TorrentController.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 1393397..6bcdcfc 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -682,6 +682,23 @@ class TorrentController extends AbstractController [ 'name' => $file->getName(), 'size' => $file->getSize(), + 'url' => $this->generateUrl( + 'torrent_download_file', + [ + 'torrentId' => $torrent->getId() + ], + false + ) + ], + 'magnet' => + [ + 'url' => $this->generateUrl( + 'torrent_download_magnet', + [ + 'torrentId' => $torrent->getId() + ], + false + ) ], 'scrape' => [ @@ -1730,12 +1747,11 @@ class TorrentController extends AbstractController // Torrent download file #[Route( - '/{_locale}/torrent/{torrentId}/download/file', + '/torrent/{torrentId}/download/file', name: 'torrent_download_file', requirements: [ - '_locale' => '%app.locales%', - 'torrentId' => '\d+', + 'torrentId' => '\d+' ], methods: [ @@ -1857,12 +1873,11 @@ class TorrentController extends AbstractController // Torrent download magnet #[Route( - '/{_locale}/torrent/{torrentId}/download/magnet', + '/torrent/{torrentId}/download/magnet', name: 'torrent_download_magnet', requirements: [ - '_locale' => '%app.locales%', - 'torrentId' => '\d+', + 'torrentId' => '\d+' ], methods: [