|
|
|
@ -33,12 +33,26 @@ class TorrentController extends AbstractController
@@ -33,12 +33,26 @@ class TorrentController extends AbstractController
|
|
|
|
|
TranslatorInterface $translator, |
|
|
|
|
UserService $userService, |
|
|
|
|
TorrentService $torrentService, |
|
|
|
|
ActivityService $activityService |
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) |
|
|
|
@ -184,10 +198,23 @@ class TorrentController extends AbstractController
@@ -184,10 +198,23 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$user->isStatus()) |
|
|
|
|
{ |
|
|
|
|
// @TODO |
|
|
|
@ -345,9 +372,22 @@ class TorrentController extends AbstractController
@@ -345,9 +372,22 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$user->isStatus()) |
|
|
|
|
{ |
|
|
|
@ -534,14 +574,27 @@ class TorrentController extends AbstractController
@@ -534,14 +574,27 @@ class TorrentController extends AbstractController
|
|
|
|
|
TranslatorInterface $translator, |
|
|
|
|
UserService $userService, |
|
|
|
|
TorrentService $torrentService, |
|
|
|
|
ActivityService $activityService, |
|
|
|
|
ActivityService $activityService |
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) |
|
|
|
|
{ |
|
|
|
@ -622,9 +675,22 @@ class TorrentController extends AbstractController
@@ -622,9 +675,22 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) |
|
|
|
@ -699,10 +765,23 @@ class TorrentController extends AbstractController
@@ -699,10 +765,23 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$user->isStatus()) |
|
|
|
|
{ |
|
|
|
|
// @TODO |
|
|
|
@ -862,9 +941,22 @@ class TorrentController extends AbstractController
@@ -862,9 +941,22 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) |
|
|
|
@ -946,9 +1038,22 @@ class TorrentController extends AbstractController
@@ -946,9 +1038,22 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($request->get('torrentId'))) |
|
|
|
@ -1017,10 +1122,23 @@ class TorrentController extends AbstractController
@@ -1017,10 +1122,23 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$user->isStatus()) |
|
|
|
|
{ |
|
|
|
|
// @TODO |
|
|
|
@ -1093,10 +1211,23 @@ class TorrentController extends AbstractController
@@ -1093,10 +1211,23 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$user->isStatus()) |
|
|
|
|
{ |
|
|
|
|
// @TODO |
|
|
|
@ -1196,10 +1327,23 @@ class TorrentController extends AbstractController
@@ -1196,10 +1327,23 @@ class TorrentController extends AbstractController
|
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Init user |
|
|
|
|
$user = $userService->init( |
|
|
|
|
$request->getClientIp() |
|
|
|
|
if (!$user = $userService->findUserByAddress($request->getClientIp())) |
|
|
|
|
{ |
|
|
|
|
$user = $userService->addUser( |
|
|
|
|
$request->getClientIp(), |
|
|
|
|
time(), |
|
|
|
|
$this->getParameter('app.locale'), |
|
|
|
|
explode('|', $this->getParameter('app.locales')), |
|
|
|
|
$this->getParameter('app.theme') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Add user join event |
|
|
|
|
$activityService->addEventUserAdd( |
|
|
|
|
$user->getId(), |
|
|
|
|
time() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!$user->isStatus()) |
|
|
|
|
{ |
|
|
|
|
// @TODO |
|
|
|
|