mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
api announce apply_filter
This commit is contained in:
@@ -148,7 +148,7 @@ class TrackerRepository extends BaseRepository
|
|||||||
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
|
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
//other system 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());
|
$repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId());
|
||||||
} finally {
|
} finally {
|
||||||
if (isset($user)) {
|
if (isset($user)) {
|
||||||
@@ -385,7 +385,7 @@ class TrackerRepository extends BaseRepository
|
|||||||
if ($torrent->banned == 'yes' && $user->class < Setting::get('authority.seebanned')) {
|
if ($torrent->banned == 'yes' && $user->class < Setting::get('authority.seebanned')) {
|
||||||
throw new TrackerException("torrent banned");
|
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
|
protected function checkPeer(Torrent $torrent, array $queries, User $user): void
|
||||||
@@ -1003,7 +1003,7 @@ class TrackerRepository extends BaseRepository
|
|||||||
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
|
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
//other system 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());
|
$repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId());
|
||||||
} finally {
|
} finally {
|
||||||
if (isset($user)) {
|
if (isset($user)) {
|
||||||
|
|||||||
+4
-2
@@ -194,8 +194,10 @@ if(get_user_class()>=$torrentmanage_class && ($CURUSER['picker'] == 'yes' || get
|
|||||||
}
|
}
|
||||||
if ($doRecommend) {
|
if ($doRecommend) {
|
||||||
do_log("[DEL_HOT_CLASSIC_RESOURCES]");
|
do_log("[DEL_HOT_CLASSIC_RESOURCES]");
|
||||||
\Nexus\Database\NexusDB::cache_del("hot_resources");
|
foreach ([$browsecatmode, $specialcatmode] as $mode) {
|
||||||
\Nexus\Database\NexusDB::cache_del("classic_resources");
|
\Nexus\Database\NexusDB::cache_del("hot_{$mode}_resources");
|
||||||
|
\Nexus\Database\NexusDB::cache_del("classic_{$mode}_resources");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user