From e74dcfd37980b96ab3b3e8e6dd0331bd5d1d5ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B8nstantine=20Kovalensky?= <45331093+kovalensky@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:28:30 +0400 Subject: [PATCH] Show file count while listing (#1082) --- library/includes/file_list_v2.php | 2 +- src/Legacy/TorrentFileList.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/includes/file_list_v2.php b/library/includes/file_list_v2.php index c50683eae..897cf8b28 100644 --- a/library/includes/file_list_v2.php +++ b/library/includes/file_list_v2.php @@ -156,7 +156,7 @@ sup {
- + '; + $filesList['count']++; } }
PathPath ({$files['count']} files) Size BTMR hash diff --git a/src/Legacy/TorrentFileList.php b/src/Legacy/TorrentFileList.php index ed411df9d..fafb6b705 100644 --- a/src/Legacy/TorrentFileList.php +++ b/src/Legacy/TorrentFileList.php @@ -165,7 +165,7 @@ class TorrentFileList */ public function fileTreeTable(array $array, string $parent = ''): array { - static $filesList = ['list' => '', 'size' => 0]; + static $filesList = ['list' => '', 'size' => 0, 'count' => 0]; foreach ($array as $key => $value) { $key = htmlCHR($key); $current = "$parent/$key"; @@ -176,6 +176,7 @@ class TorrentFileList $root = bin2hex($value['']['pieces root'] ?? ''); $filesList['size'] += $length; $filesList['list'] .= '
' . $current . '' . humn_size($length, 2) . '' . $root . '