Commit d50a4cb9 authored by skummer's avatar skummer

ZP-237 #comment do not try to calculate percentages if there are no items to...

ZP-237 #comment do not try to calculate percentages if there are no items to be synchronized #time 10m

git-svn-id: https://z-push.org/svn/z-push/trunk@1597 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 7b8dfb35
...@@ -600,8 +600,12 @@ class ZPushAdminCLI { ...@@ -600,8 +600,12 @@ class ZPushAdminCLI {
foreach ($folders as $folderid) { foreach ($folders as $folderid) {
$d = $device->GetFolderSyncStatus($folderid); $d = $device->GetFolderSyncStatus($folderid);
if ($d) { if ($d) {
$percent = round($d['done']*100/$d['total']); $status = "";
printf("\tFolder: %s%s Sync: %s Status: %s%d%% (%d/%d)\n", $d['name'], str_repeat(" ", 12-strlen($d['name'])), $d['status'], ($percent < 10)?" ":"", $percent, $d['done'], $d['total'] ); if ($d['total'] > 0) {
$percent = round($d['done']*100/$d['total']);
$status = sprintf("Status: %s%d%% (%d/%d)", ($percent < 10)?" ":"", $percent, $d['done'], $d['total']);
}
printf("\tFolder: %s%s Sync: %s %s\n", $d['name'], str_repeat(" ", 12-strlen($d['name'])), $d['status'], $status);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment