add torrent star event support #4

This commit is contained in:
ghost 2023-10-11 01:09:34 +03:00
parent ef84fefca3
commit a3dd5a81a9
7 changed files with 174 additions and 6 deletions

View file

@ -582,12 +582,14 @@ class TorrentService
int $torrentId,
int $userId,
int $added
): void
): bool
{
if ($torrentStar = $this->findTorrentStar($torrentId, $userId))
{
$this->entityManagerInterface->remove($torrentStar);
$this->entityManagerInterface->flush();
return false;
}
else
@ -600,6 +602,8 @@ class TorrentService
$this->entityManagerInterface->persist($torrentStar);
$this->entityManagerInterface->flush();
return true;
}
}