mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add wanted events support #27
This commit is contained in:
parent
5f4a14ebe2
commit
24c58d4301
20 changed files with 249 additions and 1 deletions
|
|
@ -764,6 +764,44 @@ class ActivityController extends AbstractController
|
|||
|
||||
break;
|
||||
|
||||
// Torrent Wanted
|
||||
case $activity::EVENT_TORRENT_WANTED_ADD:
|
||||
|
||||
// Init torrent
|
||||
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId()))
|
||||
{
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'default/activity/event/torrent/wanted/add' . $extension,
|
||||
[
|
||||
'id' => $activity->getId(),
|
||||
'added' => $activity->getAdded(),
|
||||
'torrent' =>
|
||||
[
|
||||
'id' => $torrent->getId(),
|
||||
'sensitive' => $torrent->isSensitive(),
|
||||
'approved' => $torrent->isApproved(),
|
||||
'name' => $torrentService->readTorrentFileByTorrentId(
|
||||
$torrent->getId()
|
||||
)->getName()
|
||||
],
|
||||
'session' =>
|
||||
[
|
||||
'user' =>
|
||||
[
|
||||
'id' => $user->getId(),
|
||||
'sensitive' => $user->isSensitive(),
|
||||
'moderator' => $user->isModerator(),
|
||||
'owner' => $user->getId() === $torrent->getUserId(),
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
/// Torrent Locales
|
||||
case $activity::EVENT_TORRENT_LOCALES_ADD:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue