mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
add torrent approved moderation tools
This commit is contained in:
parent
92c2a56bbf
commit
ed6c4ea415
8 changed files with 513 additions and 207 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue