Explorar o código

fixed encode source summary info in route install

summary info changed after upgrade source guardian
Piotr Labudda %!s(int64=8) %!d(string=hai) anos
pai
achega
405ff86c0f
Modificáronse 1 ficheiros con 18 adicións e 14 borrados
  1. 18 14
      SE/se-lib/Route/Install.php

+ 18 - 14
SE/se-lib/Route/Install.php

@@ -583,22 +583,24 @@ jQuery(document).ready(function () {
 		$statusInfo = array_reduce($returnValues, function ($ret, $encoderSummaryLine) {
 			DBG::log([$ret, $encoderSummaryLine], 'array', "DBG reduce [\$ret, \$encoderSummaryLine]");
 			$matches = [];
-			preg_match_all('/(\d+) files, (\d+) processed, (\d+) errors/', $encoderSummaryLine, $matches, PREG_SET_ORDER, 0);
+			preg_match_all('/(\d+) files, (\d+) encoded, (\d+) skipped, (\d+) errors/', $encoderSummaryLine, $matches, PREG_SET_ORDER, 0);
 			return [
 				'files' => $ret['files'] + (int)$matches[0][1],
-				'processed' => $ret['processed'] + (int)$matches[0][2],
-				'errors' => $ret['errors'] + (int)$matches[0][3],
+				'encoded' => $ret['encoded'] + (int)$matches[0][2],
+				'skipped' => $ret['skipped'] + (int)$matches[0][3],
+				'errors' => $ret['errors'] + (int)$matches[0][4],
 			];
 		}, [
 			'files' => 0,
-			'processed' => 0,
+			'encoded' => 0,
+			'skipped' => 0,
 			'errors' => 0,
 		]);
 		if ($statusInfo['errors'] === 0 && $statusInfo['files'] > 0) {
-			if ($dbg) UI::alert('success', "{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
+			if ($dbg) UI::alert('success', "{$statusInfo['files']} files, {$statusInfo['encoded']} encoded, {$statusInfo['skipped']} skipped, {$statusInfo['errors']} errors");
 		} else {
-			if ($dbg) UI::alert('danger', "{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
-			else throw new Exception("{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
+			if ($dbg) UI::alert('danger', "{$statusInfo['files']} files, {$statusInfo['encoded']} encoded, {$statusInfo['skipped']} skipped, {$statusInfo['errors']} errors");
+			else throw new Exception("{$statusInfo['files']} files, {$statusInfo['encoded']} encoded, {$statusInfo['skipped']} skipped, {$statusInfo['errors']} errors");
 		}
 	}
 
@@ -639,22 +641,24 @@ jQuery(document).ready(function () {
 		$statusInfo = array_reduce($returnValues, function ($ret, $encoderSummaryLine) {
 			DBG::log([$ret, $encoderSummaryLine], 'array', "DBG reduce [\$ret, \$encoderSummaryLine]");
 			$matches = [];
-			preg_match_all('/(\d+) files, (\d+) processed, (\d+) errors/', $encoderSummaryLine, $matches, PREG_SET_ORDER, 0);
+			preg_match_all('/(\d+) files, (\d+) encoded, (\d+) skipped, (\d+) errors/', $encoderSummaryLine, $matches, PREG_SET_ORDER, 0);
 			return [
 				'files' => $ret['files'] + (int)$matches[0][1],
-				'processed' => $ret['processed'] + (int)$matches[0][2],
-				'errors' => $ret['errors'] + (int)$matches[0][3],
+				'encoded' => $ret['encoded'] + (int)$matches[0][2],
+				'skipped' => $ret['skipped'] + (int)$matches[0][3],
+				'errors' => $ret['errors'] + (int)$matches[0][4],
 			];
 		}, [
 			'files' => 0,
-			'processed' => 0,
+			'encoded' => 0,
+			'skipped' => 0,
 			'errors' => 0,
 		]);
 		if ($statusInfo['errors'] === 0 && $statusInfo['files'] > 0) {
-			if ($dbg) UI::alert('success', "{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
+			if ($dbg) UI::alert('success', "{$statusInfo['files']} files, {$statusInfo['encoded']} encoded, {$statusInfo['skipped']} skipped, {$statusInfo['errors']} errors");
 		} else {
-			if ($dbg) UI::alert('danger', "{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
-			else throw new Exception("{$statusInfo['files']} files, {$statusInfo['processed']} processed, {$statusInfo['errors']} errors");
+			if ($dbg) UI::alert('danger', "{$statusInfo['files']} files, {$statusInfo['encoded']} encoded, {$statusInfo['skipped']} skipped, {$statusInfo['errors']} errors");
+			else throw new Exception("{$statusInfo['files']} files, {$statusInfo['encoded']} encoded, {$statusInfo['skipped']} skipped, {$statusInfo['errors']} errors");
 		}
 	}