api announce apply_filter

This commit is contained in:
xiaomlove
2022-06-08 16:21:29 +08:00
parent 243273f1cb
commit 2a9b9ce919
2 changed files with 7 additions and 5 deletions

View File

@@ -148,7 +148,7 @@ class TrackerRepository extends BaseRepository
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
} catch (\Throwable $exception) {
//other system exception
do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error');
do_log("[" . get_class($exception) . "] " . $exception->getMessage() . $exception->getTraceAsString(), 'error');
$repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId());
} finally {
if (isset($user)) {
@@ -385,7 +385,7 @@ class TrackerRepository extends BaseRepository
if ($torrent->banned == 'yes' && $user->class < Setting::get('authority.seebanned')) {
throw new TrackerException("torrent banned");
}
return array_filter('torrent_detail', $torrent);
return apply_filter('torrent_detail', $torrent);
}
protected function checkPeer(Torrent $torrent, array $queries, User $user): void
@@ -1003,7 +1003,7 @@ class TrackerRepository extends BaseRepository
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
} catch (\Throwable $exception) {
//other system exception
do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error');
do_log("[" . get_class($exception) . "] " . $exception->getMessage() . $exception->getTraceAsString(), 'error');
$repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId());
} finally {
if (isset($user)) {

View File

@@ -194,8 +194,10 @@ if(get_user_class()>=$torrentmanage_class && ($CURUSER['picker'] == 'yes' || get
}
if ($doRecommend) {
do_log("[DEL_HOT_CLASSIC_RESOURCES]");
\Nexus\Database\NexusDB::cache_del("hot_resources");
\Nexus\Database\NexusDB::cache_del("classic_resources");
foreach ([$browsecatmode, $specialcatmode] as $mode) {
\Nexus\Database\NexusDB::cache_del("hot_{$mode}_resources");
\Nexus\Database\NexusDB::cache_del("classic_{$mode}_resources");
}
}
}