Browse Source

add APP_TORRENT_WANTED_FTP_FOLDER setting #27

main
ghost 1 year ago
parent
commit
5f4a14ebe2
  1. 1
      .env
  2. 1
      config/services.yaml
  3. 24
      src/Controller/TorrentController.php

1
.env

@ -88,4 +88,5 @@ APP_TORRENT_FILE_SIZE_MAX=1024000 @@ -88,4 +88,5 @@ APP_TORRENT_FILE_SIZE_MAX=1024000
# Store wanted torrent files in /app/var/ftp by /app/crontab/torrent/scrape/{key}
APP_TORRENT_WANTED_FTP_ENABLED=1
APP_TORRENT_WANTED_FTP_FOLDER=/yggtracker
APP_TORRENT_WANTED_FTP_APPROVED_ONLY=1

1
config/services.yaml

@ -19,6 +19,7 @@ parameters: @@ -19,6 +19,7 @@ parameters:
app.yggdrasil: '%env(APP_YGGDRASIL)%'
app.torrent.size.max: '%env(APP_TORRENT_FILE_SIZE_MAX)%'
app.torrent.wanted.ftp.enabled: '%env(APP_TORRENT_WANTED_FTP_ENABLED)%'
app.torrent.wanted.ftp.folder: '%env(APP_TORRENT_WANTED_FTP_FOLDER)%'
app.torrent.wanted.ftp.approved: '%env(APP_TORRENT_WANTED_FTP_APPROVED_ONLY)%'
services:

24
src/Controller/TorrentController.php

@ -2212,7 +2212,8 @@ class TorrentController extends AbstractController @@ -2212,7 +2212,8 @@ class TorrentController extends AbstractController
$torrentService->copyToFtpStorage(
$torrent->getId(),
sprintf(
'/torrents/wanted/all/wanted#%s.%s.torrent',
'%s/torrents/wanted/all/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$torrent->getId(),
$file->getName()
)
@ -2224,7 +2225,8 @@ class TorrentController extends AbstractController @@ -2224,7 +2225,8 @@ class TorrentController extends AbstractController
$torrentService->copyToFtpStorage(
$torrent->getId(),
sprintf(
'/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent',
'%s/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$torrent->getId(),
$file->getName()
)
@ -2236,7 +2238,8 @@ class TorrentController extends AbstractController @@ -2236,7 +2238,8 @@ class TorrentController extends AbstractController
$torrentService->copyToFtpStorage(
$torrent->getId(),
sprintf(
'/torrents/wanted/sensitive/no/wanted#%s.%s.torrent',
'%s/torrents/wanted/sensitive/no/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$torrent->getId(),
$file->getName()
)
@ -2249,7 +2252,8 @@ class TorrentController extends AbstractController @@ -2249,7 +2252,8 @@ class TorrentController extends AbstractController
$torrentService->copyToFtpStorage(
$torrent->getId(),
sprintf(
'/torrents/wanted/locale/%s/wanted#%s.%s.torrent',
'%s/torrents/wanted/locale/%s/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$locale,
$torrent->getId(),
$file->getName()
@ -2265,7 +2269,8 @@ class TorrentController extends AbstractController @@ -2265,7 +2269,8 @@ class TorrentController extends AbstractController
/// All
$torrentService->removeFromFtpStorage(
sprintf(
'/torrents/wanted/all/wanted#%s.%s.torrent',
'%s/torrents/wanted/all/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$torrent->getId(),
$file->getName()
)
@ -2274,7 +2279,8 @@ class TorrentController extends AbstractController @@ -2274,7 +2279,8 @@ class TorrentController extends AbstractController
/// Sensitive
$torrentService->removeFromFtpStorage(
sprintf(
'/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent',
'%s/torrents/wanted/sensitive/yes/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$torrent->getId(),
$file->getName()
)
@ -2282,7 +2288,8 @@ class TorrentController extends AbstractController @@ -2282,7 +2288,8 @@ class TorrentController extends AbstractController
$torrentService->removeFromFtpStorage(
sprintf(
'/torrents/wanted/sensitive/no/wanted#%s.%s.torrent',
'%s/torrents/wanted/sensitive/no/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$torrent->getId(),
$file->getName()
)
@ -2293,7 +2300,8 @@ class TorrentController extends AbstractController @@ -2293,7 +2300,8 @@ class TorrentController extends AbstractController
{
$torrentService->removeFromFtpStorage(
sprintf(
'/torrents/wanted/locale/%s/wanted#%s.%s.torrent',
'%s/torrents/wanted/locale/%s/wanted#%s.%s.torrent',
$this->getParameter('app.torrent.wanted.ftp.folder'),
$locale,
$torrent->getId(),
$file->getName()

Loading…
Cancel
Save