Fix public tag tracker script
This commit is contained in:
parent
0ecbdf9020
commit
1f33d611d9
@ -9,13 +9,16 @@
|
||||
$limit = isset($cliOptions['l']) && $cliOptions['l'] === false;
|
||||
$old = isset($cliOptions['o']) && $cliOptions['o'] === false;
|
||||
|
||||
$tag = (string) env('QBITTORRENT_PUBLIC_TAG', 'public-trackers');
|
||||
|
||||
$qBitClient = new QBitClient();
|
||||
$torrents = $qBitClient->getBasicTorrentsInfo();
|
||||
$torrents = array_filter(
|
||||
$torrents,
|
||||
function ($torrent)
|
||||
function ($torrent) use ($tag)
|
||||
{
|
||||
return empty($torrent['tags']) && $torrent['trackers_count'] >= 5;
|
||||
$tags = $torrent['tags'];
|
||||
return !str_contains($tags, $tag) && $torrent['trackers_count'] >= 5;
|
||||
}
|
||||
);
|
||||
|
||||
@ -40,7 +43,6 @@
|
||||
|
||||
// Reset all array keys for torrents
|
||||
$torrents = array_values($torrents);
|
||||
$tag = (string) env('QBITTORRENT_PUBLIC_TAG', 'public-trackers');
|
||||
|
||||
if (!empty($torrents)) {
|
||||
$torrentHashes = array_map(
|
||||
|
@ -33,7 +33,7 @@
|
||||
/**
|
||||
* Gets the full tracker list of every torrent, if necessary.
|
||||
*
|
||||
* @param QBitClient $qBitClient
|
||||
* @param Decicus\qBitTorrent\Client $qBitClient
|
||||
* @param array $torrents Array of torrents, such as the one returned by getBasicTorrentsInfo()
|
||||
* @param array $trackerCache Array of already cached trackers for a specific hostname
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user