Debug output tweak
This commit is contained in:
58
Yuba.php
58
Yuba.php
@@ -26,6 +26,7 @@ require("filetypes.php");
|
||||
|
||||
$wopt_steps = 12;
|
||||
$wopt_currstep = 1;
|
||||
$wopt_clear = 0;
|
||||
|
||||
$parser = new plistParser();
|
||||
|
||||
@@ -462,7 +463,7 @@ foreach ($files as $splFileInfo) {
|
||||
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
// Thow permissions error
|
||||
|
||||
@@ -476,13 +477,28 @@ if (count($noread)) {
|
||||
|
||||
// Write family to DB
|
||||
|
||||
$dupes = array_filter($dx, function($a) { return count($a) > 1; });
|
||||
$dupecount = 0;
|
||||
$dupetotal = 0;
|
||||
|
||||
if (count($dupes)) {
|
||||
$dupecount = count($dupes,COUNT_RECURSIVE) - count($dupes);
|
||||
$dupetotal = floor(($dupecount/$passed_total)*100);
|
||||
foreach ($dupes as $fid => $array) {
|
||||
$stmt = $dbo->prepare("INSERT INTO dupes VALUES (:fid, :array)");
|
||||
$stmt->BindValue(":fid",$fid);
|
||||
$stmt->BindValue(":array",serialize($array));
|
||||
$stmt->execute();
|
||||
}
|
||||
}
|
||||
|
||||
$message = "Writing family to DB: ";
|
||||
$message .= $passed_file." files, ";
|
||||
$message .= $passed_dir." dirs, ";
|
||||
$message .= $nodescended." bundles, ";
|
||||
$message .= $passed_link." links, ";
|
||||
$message .= $ignored." ignored, ";
|
||||
//$message .= (@$dupecount ? $dupecount : 0)." dupes";
|
||||
$message .= $dupecount." dupes (".$dupetotal."%)";
|
||||
|
||||
echo ProgressBar::start(count($family),$message);
|
||||
|
||||
@@ -502,23 +518,7 @@ foreach ($family as $key => $item) {
|
||||
|
||||
}
|
||||
|
||||
// Dupes
|
||||
|
||||
$dupes = array_filter($dx, function($a) { return count($a) > 1; });
|
||||
|
||||
if (count($dupes)) {
|
||||
$dupecount = count($dupes,COUNT_RECURSIVE) - count($dupes);
|
||||
$dupetotal = floor(($dupecount/$passed_total)*100);
|
||||
echo ProgressBar::next("Recording dupes (".$dupetotal."%)");
|
||||
foreach ($dupes as $fid => $array) {
|
||||
$stmt = $dbo->prepare("INSERT INTO dupes VALUES (:fid, :array)");
|
||||
$stmt->BindValue(":fid",$fid);
|
||||
$stmt->BindValue(":array",serialize($array));
|
||||
$stmt->execute();
|
||||
}
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
// create an index for family db
|
||||
$dbo->exec("CREATE INDEX family_index ON family (pid)");
|
||||
@@ -551,7 +551,7 @@ foreach ($fx as $array) {
|
||||
}
|
||||
echo ProgressBar::next();
|
||||
}
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
// Icons Test
|
||||
//////////////////////////////////////////
|
||||
@@ -576,13 +576,13 @@ if ($p['icons']) {
|
||||
}
|
||||
file_put_contents($batchfile,implode("\n", $line));
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
echo ProgressBar::start($passed_file,"Running icon batch (".stepString().")");
|
||||
|
||||
passthru($bin_parallel." < ".$batchfile);
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ if ($p['thumbs']) {
|
||||
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
}
|
||||
|
||||
@@ -760,7 +760,7 @@ if ($p['contents']) {
|
||||
echo ProgressBar::next(true);
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
}
|
||||
|
||||
@@ -822,7 +822,7 @@ if ($p['meta']) {
|
||||
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ if ($p['hash']) {
|
||||
}
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
}
|
||||
|
||||
@@ -968,7 +968,7 @@ if ($p['spotlight']) {
|
||||
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ foreach ($files as $splFileInfo) {
|
||||
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
// Milk
|
||||
//////////////////////////////////////////
|
||||
@@ -1349,7 +1349,7 @@ while ($row_a = $loop->fetch()) {
|
||||
|
||||
}
|
||||
|
||||
echo ProgressBar::finish();
|
||||
echo ProgressBar::finish($wopt_clear);
|
||||
|
||||
// Cleanup
|
||||
//////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user