add torrent approved moderation tools

This commit is contained in:
ghost 2023-10-13 02:28:50 +03:00
parent 92c2a56bbf
commit ed6c4ea415
8 changed files with 513 additions and 207 deletions

View file

@ -298,6 +298,30 @@ class TorrentService
return $torrent;
}
public function toggleTorrentApproved(
int $torrentId
): ?Torrent
{
$torrent = $this->getTorrent($torrentId);
$torrent->setApproved(
!$torrent->isApproved() // toggle current value
);
$this->entityManagerInterface->persist($torrent);
$this->entityManagerInterface->flush();
$this->updateTorrentLocales(
$torrent->getId()
);
$this->updateTorrentSensitive(
$torrent->getId()
);
return $torrent;
}
public function getTorrentScrapeQueue(): ?Torrent
{
return $this->entityManagerInterface