mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
request scrape update on torrent download
This commit is contained in:
parent
83ea09adad
commit
a47893ff9b
2 changed files with 34 additions and 0 deletions
|
|
@ -1826,6 +1826,12 @@ class TorrentController extends AbstractController
|
||||||
time()
|
time()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Request scrape
|
||||||
|
$torrentService->updateTorrentScraped(
|
||||||
|
$torrent->getId(),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
// Register download event
|
// Register download event
|
||||||
$activityService->addEventTorrentDownloadFileAdd(
|
$activityService->addEventTorrentDownloadFileAdd(
|
||||||
$user->getId(),
|
$user->getId(),
|
||||||
|
|
@ -1947,6 +1953,12 @@ class TorrentController extends AbstractController
|
||||||
time()
|
time()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Request scrape
|
||||||
|
$torrentService->updateTorrentScraped(
|
||||||
|
$torrent->getId(),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
// Register download event
|
// Register download event
|
||||||
$activityService->addEventTorrentDownloadFileAdd(
|
$activityService->addEventTorrentDownloadFileAdd(
|
||||||
$user->getId(),
|
$user->getId(),
|
||||||
|
|
@ -2065,6 +2077,12 @@ class TorrentController extends AbstractController
|
||||||
time()
|
time()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Request scrape
|
||||||
|
$torrentService->updateTorrentScraped(
|
||||||
|
$torrent->getId(),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
// Register download event
|
// Register download event
|
||||||
$activityService->addEventTorrentDownloadMagnetAdd(
|
$activityService->addEventTorrentDownloadMagnetAdd(
|
||||||
$user->getId(),
|
$user->getId(),
|
||||||
|
|
|
||||||
|
|
@ -407,6 +407,22 @@ class TorrentService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateTorrentScraped(
|
||||||
|
int $torrentId,
|
||||||
|
int $time
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
if ($torrent = $this->getTorrent($torrentId))
|
||||||
|
{
|
||||||
|
$torrent->setScraped(
|
||||||
|
time()
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->entityManagerInterface->persist($torrent);
|
||||||
|
$this->entityManagerInterface->flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function updateTorrentScrape(
|
public function updateTorrentScrape(
|
||||||
int $torrentId,
|
int $torrentId,
|
||||||
int $seeders,
|
int $seeders,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue