[add] show file size and replace size by dimension

This commit is contained in:
Knah Tsaeb 2015-03-19 14:49:14 +01:00
parent 02333b253f
commit 910e928ba5
2 changed files with 11 additions and 1 deletions

View File

@ -295,8 +295,12 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) {
<td>', $videoInfo['duration'], '</td>
<tr>
<tr>
<th>Size</th>
<th>Dimension</th>
<td>', $videoInfo['size'], '</td>
<tr>
<tr>
<th>Size</th>
<td>', humanFilesize(filesize($videoInfo['hash'].'.webm')), '</td>
<tr>
<th>Publish date</th>
<td>', date("d m Y", strtotime($videoInfo['uploadDate'])), '</td>

View File

@ -754,6 +754,12 @@ function clearCache() {
}
}
function humanFilesize($bytes, $decimals = 2) {
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}
if (isset($ci['ac']) && !empty($ci['ac']) && $ci['ac'] === 'm3u') {
makePLaylist($ci['bc']);
}