|
|
@ -209,6 +209,7 @@ class TorrentService |
|
|
|
$torrent = $this->addTorrent( |
|
|
|
$torrent = $this->addTorrent( |
|
|
|
$userId, |
|
|
|
$userId, |
|
|
|
$added, |
|
|
|
$added, |
|
|
|
|
|
|
|
md5_file($filepath), |
|
|
|
$this->generateTorrentKeywordsByTorrentFilepath( |
|
|
|
$this->generateTorrentKeywordsByTorrentFilepath( |
|
|
|
$filepath |
|
|
|
$filepath |
|
|
|
), |
|
|
|
), |
|
|
@ -256,6 +257,7 @@ class TorrentService |
|
|
|
public function addTorrent( |
|
|
|
public function addTorrent( |
|
|
|
int $userId, |
|
|
|
int $userId, |
|
|
|
int $added, |
|
|
|
int $added, |
|
|
|
|
|
|
|
string $md5file, |
|
|
|
string $keywords, |
|
|
|
string $keywords, |
|
|
|
bool $approved |
|
|
|
bool $approved |
|
|
|
): ?Torrent |
|
|
|
): ?Torrent |
|
|
@ -264,6 +266,7 @@ class TorrentService |
|
|
|
|
|
|
|
|
|
|
|
$torrent->setUserId($userId); |
|
|
|
$torrent->setUserId($userId); |
|
|
|
$torrent->setAdded($added); |
|
|
|
$torrent->setAdded($added); |
|
|
|
|
|
|
|
$torrent->setMd5File($md5file); |
|
|
|
$torrent->setKeywords($keywords); |
|
|
|
$torrent->setKeywords($keywords); |
|
|
|
$torrent->setApproved($approved); |
|
|
|
$torrent->setApproved($approved); |
|
|
|
|
|
|
|
|
|
|
@ -294,6 +297,17 @@ class TorrentService |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function findTorrentByMd5File(string $md5file) : ?Torrent |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return $this->entityManagerInterface |
|
|
|
|
|
|
|
->getRepository(Torrent::class) |
|
|
|
|
|
|
|
->findOneBy( |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
'md5file' => $md5file |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function setTorrentsApprovedByUserId( |
|
|
|
public function setTorrentsApprovedByUserId( |
|
|
|
int $userId, |
|
|
|
int $userId, |
|
|
|
bool $value |
|
|
|
bool $value |
|
|
|