1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Fix misleading import progress

This commit is contained in:
Thomas Tanghus 2013-09-24 17:35:25 +02:00
parent 44a41c184c
commit efc3a9c7d8

View File

@ -216,10 +216,10 @@ class ImportController extends Controller {
return $response;
}
//import the contacts
$writeProgress('40');
$imported = 0;
$failed = 0;
$partially = 0;
$processed = 0;
// TODO: Add a new group: "Imported at {date}"
foreach($parts as $part) {
@ -244,12 +244,13 @@ class ImportController extends Controller {
* - continue
*/
try {
$processed += 1;
if($addressBook->addChild($vcard)) {
$imported += 1;
$writeProgress($imported);
} else {
$failed += 1;
}
$writeProgress($processed);
} catch (\Exception $e) {
$response->debug('Error importing vcard: ' . $e->getMessage() . $nl . $vcard->serialize());
$failed += 1;