implement additional torrent fields index, add indexer configuration #31

This commit is contained in:
ghost 2023-10-27 21:22:16 +03:00
parent afcacebe26
commit c7c5d7340c
4 changed files with 248 additions and 44 deletions

View file

@ -880,7 +880,19 @@ class TorrentController extends AbstractController
{
// Save data
$torrent = $torrentService->add(
$file->getPathName(),
(bool) $this->getParameter('app.index.torrent.name'),
(bool) $this->getParameter('app.index.torrent.filenames'),
(bool) $this->getParameter('app.index.torrent.hash.v1'),
(bool) $this->getParameter('app.index.torrent.hash.v2'),
(bool) $this->getParameter('app.index.torrent.source'),
(bool) $this->getParameter('app.index.torrent.comment'),
(bool) $this->getParameter('app.index.transliteration'),
(int) $this->getParameter('app.index.word.length.min'),
(int) $this->getParameter('app.index.word.length.max'),
$user->getId(),
time(),
(array) $locales,
@ -2440,7 +2452,17 @@ class TorrentController extends AbstractController
): Response
{
// Reindex keywords
$torrentService->reindexTorrentKeywordsAll();
$torrentService->reindexTorrentKeywordsAll(
(bool) $this->getParameter('app.index.torrent.name'),
(bool) $this->getParameter('app.index.torrent.filenames'),
(bool) $this->getParameter('app.index.torrent.hash.v1'),
(bool) $this->getParameter('app.index.torrent.hash.v2'),
(bool) $this->getParameter('app.index.torrent.source'),
(bool) $this->getParameter('app.index.torrent.comment'),
(bool) $this->getParameter('app.index.transliteration'),
(int) $this->getParameter('app.index.word.length.min'),
(int) $this->getParameter('app.index.word.length.max')
);
// Render response
return new Response(); // @TODO