diff --git a/Tester.zip b/Tester.zip index 54a6347..01c6a20 100644 Binary files a/Tester.zip and b/Tester.zip differ diff --git a/Yuba.app.zip b/Yuba.app.zip index 2c9efec..4315a32 100644 Binary files a/Yuba.app.zip and b/Yuba.app.zip differ diff --git a/Yuba.php b/Yuba.php index c17f1cd..7ef5fb5 100755 --- a/Yuba.php +++ b/Yuba.php @@ -405,7 +405,6 @@ $i = 0; $family = array(); $fids = array(); $noread = array(); -$fx = new SplFixedArray($passed_file); $splcount = 0; $bline = array(); @@ -418,24 +417,23 @@ foreach ($files as $splFileInfo) { $shellpath = escapeshellarg($splFileInfo->getPathname()); $realpath = $splFileInfo->getRealPath(); - $fid = md5($splFileInfo->getSize().$splFileInfo->getMtime().$splFileInfo->getBasename()); - - $key = md5($pathname); + $pid = md5($pathname); $pkey = md5($path); + $fid = null; - if (array_key_exists($key, $family)) { + if (array_key_exists($pid, $family)) { echo msg("Duplicate key on ".$pathname.""); die; } - $family[$key] = array(); + $family[$pid] = array(); // Path-agnostic Unique File ID (to prevent redundant hashes and thumbs) if ($splFileInfo->getType() != "dir" && $splFileInfo->getType() != "link") { + $fid = md5($splFileInfo->getSize().$splFileInfo->getMtime().$splFileInfo->getBasename()); $dx[$fid][] = $pathname; - $fx[$splcount] = array($fid, $pathname); - $family[$key]['fid'] = $fid; + $family[$pid]['fid'] = $fid; $splcount++; } @@ -463,12 +461,14 @@ foreach ($files as $splFileInfo) { if ($p['thumbs'] || $p['icons'] || $p['meta'] || $p['hash'] || $p['contents'] || $p['spotlight']) { + + $parts = array(); $parts[] = $bin_php; $parts[] = escapeshellarg(realpath("helper.php")); $parts[] = $i; $parts[] = $passed_total; - $parts[] = $fid; + $parts[] = $fid ?: $pid; $parts[] = escapeshellarg($pathname); $parts[] = $splFileInfo->getType(); $parts[] = escapeshellarg($bpath); @@ -476,7 +476,6 @@ foreach ($files as $splFileInfo) { $parts[] = $p['spotlight']; $tcmd = implode(" ",$parts); - //msg($tcmd); $bline[] = $tcmd; } @@ -489,7 +488,6 @@ foreach ($files as $splFileInfo) { // Children - //$family[$pkey]['children'][] = $key; $family[$pkey]['children'][] = $i+1; echo ProgressBar::next(true); @@ -1040,6 +1038,6 @@ $done = "Finished ".$zpath." in ".$seconds." seconds"; $done_m = "Memory usage: ".prettysize(memory_get_usage(true)); echo msg($done."\n".$done_m); notification($done); -unset($dbo, $dbp, $files, $family, $fx); +unset($dbo, $dbp, $files, $family); ?> \ No newline at end of file diff --git a/helper.php b/helper.php index 413598b..4c62fcc 100755 --- a/helper.php +++ b/helper.php @@ -230,7 +230,6 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") { // Icons ////////////////////////////////////////// icons: -//if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store") { if ($p['icons'] && $ext != "DS_Store") { dfm("ICONS",1); @@ -307,7 +306,7 @@ if ($p['icons'] && $ext != "DS_Store") { if ($btype == "dir") { dfm($pathname." is a dir, proceeding with directory check"); - $stmt->BindValue(":fid",$pid); + $stmt->BindValue(":fid",$fid); if (file_exists($pathname."/Icon\r")) { dfm("Custom icon found, processing ".$pathname." with qltool"); $tools = array("qltool");