mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Show file count while listing (#1082)
This commit is contained in:
parent
abccc7ca07
commit
e74dcfd379
2 changed files with 3 additions and 2 deletions
|
@ -156,7 +156,7 @@ sup {
|
||||||
<hr>
|
<hr>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Path</th>
|
<th>Path ({$files['count']} files)</th>
|
||||||
<th>Size</th>
|
<th>Size</th>
|
||||||
<th class="tooltip" style="width: auto;">
|
<th class="tooltip" style="width: auto;">
|
||||||
BTMR hash
|
BTMR hash
|
||||||
|
|
|
@ -165,7 +165,7 @@ class TorrentFileList
|
||||||
*/
|
*/
|
||||||
public function fileTreeTable(array $array, string $parent = ''): array
|
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) {
|
foreach ($array as $key => $value) {
|
||||||
$key = htmlCHR($key);
|
$key = htmlCHR($key);
|
||||||
$current = "$parent/$key";
|
$current = "$parent/$key";
|
||||||
|
@ -176,6 +176,7 @@ class TorrentFileList
|
||||||
$root = bin2hex($value['']['pieces root'] ?? '');
|
$root = bin2hex($value['']['pieces root'] ?? '');
|
||||||
$filesList['size'] += $length;
|
$filesList['size'] += $length;
|
||||||
$filesList['list'] .= '<tr><td>' . $current . '</td><td>' . humn_size($length, 2) . '</td><td>' . $root . '</td></tr><tr>';
|
$filesList['list'] .= '<tr><td>' . $current . '</td><td>' . humn_size($length, 2) . '</td><td>' . $root . '</td></tr><tr>';
|
||||||
|
$filesList['count']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue