mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
implement torrent search features
This commit is contained in:
parent
e9375f9127
commit
8ab4c0b9cf
7 changed files with 293 additions and 12 deletions
|
|
@ -246,11 +246,11 @@ class TorrentService
|
|||
}
|
||||
|
||||
// Torrent
|
||||
public function getTorrent(int $id): ?Torrent
|
||||
public function getTorrent(int $torrentId): ?Torrent
|
||||
{
|
||||
return $this->entityManagerInterface
|
||||
->getRepository(Torrent::class)
|
||||
->find($id);
|
||||
->find($torrentId);
|
||||
}
|
||||
|
||||
public function addTorrent(
|
||||
|
|
@ -285,6 +285,15 @@ class TorrentService
|
|||
);
|
||||
}
|
||||
|
||||
public function searchTorrents(string $query) : array
|
||||
{
|
||||
return $this->entityManagerInterface
|
||||
->getRepository(Torrent::class)
|
||||
->searchByKeywords(
|
||||
explode(' ', $query)
|
||||
);
|
||||
}
|
||||
|
||||
public function setTorrentsApprovedByUserId(
|
||||
int $userId,
|
||||
bool $value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue