From e2507f931c5b853755ec23712b16467bf75393b0 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:47:18 +0100 Subject: [PATCH] chore(occ): print storage values human-friendly Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- core/Command/User/Info.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/Command/User/Info.php b/core/Command/User/Info.php index 55298f0164caa..886f8aafdc66f 100644 --- a/core/Command/User/Info.php +++ b/core/Command/User/Info.php @@ -77,11 +77,11 @@ protected function getStorageInfo(IUser $user): array { return []; } return [ - 'free' => $storage['free'], - 'used' => $storage['used'], - 'total' => $storage['total'], - 'relative' => $storage['relative'], - 'quota' => $storage['quota'], + 'free' => \OC_Helper::humanFileSize($storage['free']), + 'used' => \OC_Helper::humanFileSize($storage['used']), + 'total' => \OC_Helper::humanFileSize($storage['total']), + 'usedSpacePercent' => $storage['relative'] .'%', + 'quota' => ($storage['quota'] > 0) ? \OC_Helper::humanFileSize($storage['quota']) : $storage['quota'], ]; }