add command event:fire + fetch imdb when torrent created

This commit is contained in:
xiaomlove
2024-02-23 02:38:42 +08:00
parent 5c6a2b13f9
commit 9efa5b2ae5
12 changed files with 227 additions and 24 deletions
+4
View File
@@ -349,6 +349,7 @@ $insert = [
'technical_info' => $_POST['technical_info'] ?? '',
'cover' => $cover,
'pieces_hash' => sha1($info['pieces']),
'cache_stamp' => time(),
];
if (isset($_POST['hr'][$catmod]) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr'][$catmod]]) && user_can('torrent_hr')) {
$insert['hr'] = $_POST['hr'][$catmod];
@@ -446,6 +447,9 @@ $searchRep->addTorrent($id);
$meiliSearch = new \App\Repositories\MeiliSearchRepository();
$meiliSearch->doImportFromDatabase($id);
//trigger event
executeCommand("event:fire --name=torrent_created --id=$id", "string", true, false);
//===notify people who voted on offer thanks CoLdFuSiOn :)
if ($is_offer)
{