This commit is contained in:
2019-10-19 06:28:02 -07:00
parent 8166dfa42f
commit 6edb46cc86
4 changed files with 11 additions and 14 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -405,7 +405,6 @@ $i = 0;
$family = array(); $family = array();
$fids = array(); $fids = array();
$noread = array(); $noread = array();
$fx = new SplFixedArray($passed_file);
$splcount = 0; $splcount = 0;
$bline = array(); $bline = array();
@@ -418,24 +417,23 @@ foreach ($files as $splFileInfo) {
$shellpath = escapeshellarg($splFileInfo->getPathname()); $shellpath = escapeshellarg($splFileInfo->getPathname());
$realpath = $splFileInfo->getRealPath(); $realpath = $splFileInfo->getRealPath();
$fid = md5($splFileInfo->getSize().$splFileInfo->getMtime().$splFileInfo->getBasename()); $pid = md5($pathname);
$key = md5($pathname);
$pkey = md5($path); $pkey = md5($path);
$fid = null;
if (array_key_exists($key, $family)) { if (array_key_exists($pid, $family)) {
echo msg("Duplicate key on ".$pathname.""); die; echo msg("Duplicate key on ".$pathname.""); die;
} }
$family[$key] = array(); $family[$pid] = array();
// Path-agnostic Unique File ID (to prevent redundant hashes and thumbs) // Path-agnostic Unique File ID (to prevent redundant hashes and thumbs)
if ($splFileInfo->getType() != "dir" && $splFileInfo->getType() != "link") { if ($splFileInfo->getType() != "dir" && $splFileInfo->getType() != "link") {
$fid = md5($splFileInfo->getSize().$splFileInfo->getMtime().$splFileInfo->getBasename());
$dx[$fid][] = $pathname; $dx[$fid][] = $pathname;
$fx[$splcount] = array($fid, $pathname); $family[$pid]['fid'] = $fid;
$family[$key]['fid'] = $fid;
$splcount++; $splcount++;
} }
@@ -463,12 +461,14 @@ foreach ($files as $splFileInfo) {
if ($p['thumbs'] || $p['icons'] || $p['meta'] || $p['hash'] || $p['contents'] || $p['spotlight']) { if ($p['thumbs'] || $p['icons'] || $p['meta'] || $p['hash'] || $p['contents'] || $p['spotlight']) {
$parts = array(); $parts = array();
$parts[] = $bin_php; $parts[] = $bin_php;
$parts[] = escapeshellarg(realpath("helper.php")); $parts[] = escapeshellarg(realpath("helper.php"));
$parts[] = $i; $parts[] = $i;
$parts[] = $passed_total; $parts[] = $passed_total;
$parts[] = $fid; $parts[] = $fid ?: $pid;
$parts[] = escapeshellarg($pathname); $parts[] = escapeshellarg($pathname);
$parts[] = $splFileInfo->getType(); $parts[] = $splFileInfo->getType();
$parts[] = escapeshellarg($bpath); $parts[] = escapeshellarg($bpath);
@@ -476,7 +476,6 @@ foreach ($files as $splFileInfo) {
$parts[] = $p['spotlight']; $parts[] = $p['spotlight'];
$tcmd = implode(" ",$parts); $tcmd = implode(" ",$parts);
//msg($tcmd);
$bline[] = $tcmd; $bline[] = $tcmd;
} }
@@ -489,7 +488,6 @@ foreach ($files as $splFileInfo) {
// Children // Children
//$family[$pkey]['children'][] = $key;
$family[$pkey]['children'][] = $i+1; $family[$pkey]['children'][] = $i+1;
echo ProgressBar::next(true); echo ProgressBar::next(true);
@@ -1040,6 +1038,6 @@ $done = "Finished ".$zpath." in ".$seconds." seconds";
$done_m = "Memory usage: ".prettysize(memory_get_usage(true)); $done_m = "Memory usage: ".prettysize(memory_get_usage(true));
echo msg($done."\n".$done_m); notification($done); echo msg($done."\n".$done_m); notification($done);
unset($dbo, $dbp, $files, $family, $fx); unset($dbo, $dbp, $files, $family);
?> ?>

View File

@@ -230,7 +230,6 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") {
// Icons ////////////////////////////////////////// // Icons //////////////////////////////////////////
icons: icons:
//if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store") {
if ($p['icons'] && $ext != "DS_Store") { if ($p['icons'] && $ext != "DS_Store") {
dfm("ICONS",1); dfm("ICONS",1);
@@ -307,7 +306,7 @@ if ($p['icons'] && $ext != "DS_Store") {
if ($btype == "dir") { if ($btype == "dir") {
dfm($pathname." is a dir, proceeding with directory check"); dfm($pathname." is a dir, proceeding with directory check");
$stmt->BindValue(":fid",$pid); $stmt->BindValue(":fid",$fid);
if (file_exists($pathname."/Icon\r")) { if (file_exists($pathname."/Icon\r")) {
dfm("Custom icon found, processing ".$pathname." with qltool"); dfm("Custom icon found, processing ".$pathname." with qltool");
$tools = array("qltool"); $tools = array("qltool");