refactor event

This commit is contained in:
xiaomlove
2024-04-25 02:15:56 +08:00
parent 52c3365873
commit ae29693549
15 changed files with 57 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.12');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-04-24');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-04-25');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -3133,7 +3133,6 @@ function deletetorrent($id, $notify = false) {
if ($torrentInfo->has($_id)) {
$torrentRep->delPiecesHashCache($torrentInfo->get($_id)->pieces_hash);
}
do_action("torrent_delete", $_id);
do_log("delete torrent: $_id", "error");
unlink(getFullDirectory("$torrent_dir/$_id.torrent"));
\App\Models\TorrentOperationLog::add([
@@ -3145,6 +3144,10 @@ function deletetorrent($id, $notify = false) {
}
$meiliSearchRep = new \App\Repositories\MeiliSearchRepository();
$meiliSearchRep->deleteDocuments($idArr);
if (is_int($id)) {
do_action("torrent_delete", $id);
fire_event("torrent_deleted", $id);
}
}
function pager($rpp, $count, $href, $opts = array(), $pagename = "page") {