diff --git a/CHANGELOG.md b/CHANGELOG.md index 0563aa5..279139f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,11 @@ All notable changes to this project will be documented in this file. Older changes are summarized on individual commits. ## [0.8.0.2] -- Tweaks to directory icons +- Tweaks to directory and bundle icons - Output redirection fixes - Thumbnail bindings - "Add to existing" prefs option +- Fixed a fid bug introduced in 0.8.0.0 ## [0.8.0.1] - Move batchfile generation to Prescan diff --git a/Tester.zip b/Tester.zip index 01c6a20..c0f97e6 100644 Binary files a/Tester.zip and b/Tester.zip differ diff --git a/Yuba.app.zip b/Yuba.app.zip index 4315a32..35af182 100644 Binary files a/Yuba.app.zip and b/Yuba.app.zip differ diff --git a/Yuba.php b/Yuba.php index 7ef5fb5..c20c2f9 100755 --- a/Yuba.php +++ b/Yuba.php @@ -461,8 +461,6 @@ 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")); @@ -765,18 +763,8 @@ foreach ($files as $splFileInfo) { // Pool - if ($type == "dir") { + if ($type == "file") { - unset($fetch_icon); - - $fetch_icon = @$dbp->query("SELECT * FROM icons WHERE fid='".$pid."'")->fetch(); - if (@$fetch_icon['relative_path']) { - $stmt->BindValue(":icon_filename",$fetch_icon['relative_path']); - $stmt->BindValue(":icon_tool",$fetch_icon['tool']); - } - - } elseif ($type == "file") { - $fetch_icon = @$dbp->query("SELECT * FROM icons WHERE fid='".$fid."'")->fetch(); if (@$fetch_icon['relative_path']) { $stmt->BindValue(":icon_filename",$fetch_icon['relative_path']); @@ -808,6 +796,27 @@ foreach ($files as $splFileInfo) { $stmt->BindValue(":thumb_filename",null); } + } else { + + unset($fetch_icon, $fetch_thumb); + + $fetch_icon = @$dbp->query("SELECT * FROM icons WHERE fid='".$pid."'")->fetch(); + if (@$fetch_icon['relative_path']) { + $stmt->BindValue(":icon_filename",$fetch_icon['relative_path']); + $stmt->BindValue(":icon_tool",$fetch_icon['tool']); + } + + $fetch_thumb = $dbp->query("SELECT * FROM thumbs WHERE fid='".$pid."'")->fetch(); + + if (@$fetch_thumb['relative_path']) { + $stmt->BindValue(":thumb_filename",$fetch_thumb['relative_path']); + $stmt->BindValue(":thumb_width",$fetch_thumb['width']); + $stmt->BindValue(":thumb_height",$fetch_thumb['height']); + $stmt->BindValue(":thumb_tool",$fetch_thumb['tool']); + } else { + $stmt->BindValue(":thumb_filename",null); + } + } // ------------------------------------------------ // diff --git a/filetypes.php b/filetypes.php index 8da943b..9db07dc 100755 --- a/filetypes.php +++ b/filetypes.php @@ -128,6 +128,8 @@ $p['t_b']['m4a'] = array("sox","ql-thumbnail"); $p['t_b']['m4b'] = array("sox","ql-thumbnail"); $p['t_b']['ogg'] = array("sox","ql-thumbnail"); +foreach ($p['bundles'] as $bundle) { $p['t_b'][$bundle] = array("qltool"); } + $p['t_b']['*'] = "ql-thumbnail"; // Don't make icons for these files @@ -303,7 +305,7 @@ foreach (array_merge($mb['t'],$mb['a']) as $item) { $ibuild[] = ":".$item; } -unset($item); +unset($item, $bundle, $ext, $file); // Album dirs ////////////////////////////////////////// diff --git a/helper.php b/helper.php index 4c62fcc..3ecd764 100755 --- a/helper.php +++ b/helper.php @@ -90,7 +90,7 @@ dfm("BATCH INIT ".$file.":".print_r($argv,true),2); // Thumbs ////////////////////////////////////////// thumbs: -if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") { +if ($p['thumbs'] && $ext && $ext != "DS_Store") { dfm("THUMBS",1); @@ -162,6 +162,7 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") { $cmd['ql-thumbnail'] = $bin_qlthumb." ".$shellpath." ".$tfile." public.jpeg ".$p['thumb_size']." ".$p['thumb_size']." .8"; $cmd['qlmanage'] = $bin_qlmanage." -t -s ".$p['thumb_size']." -o ".dirname($tpfile)." ".$shellpath."; ".$bin_sips." -s format jpeg -s formatOptions 80 ".escapeshellarg($tpfile)." --out ".$tfile; + $cmd['qltool'] = $bin_qltool." dp ".$shellpath." ".$p['thumb_size']." ".$p['thumb_size']." | base64 --decode | ".$bin_convert." - -scale 50% ".$tfile; switch ($p['thumb_mode']) { case 0: // most files @@ -307,8 +308,8 @@ if ($p['icons'] && $ext != "DS_Store") { if ($btype == "dir") { dfm($pathname." is a dir, proceeding with directory check"); $stmt->BindValue(":fid",$fid); - if (file_exists($pathname."/Icon\r")) { - dfm("Custom icon found, processing ".$pathname." with qltool"); + if ($ext || file_exists($pathname."/Icon\r")) { + dfm("Ext or custom icon found, processing ".$pathname." with qltool"); $tools = array("qltool"); } elseif (glob($globsafe."/".globstring($p['album_files']),GLOB_BRACE) && $test = glob($globsafe."/".globstring($p['cover_exts'],$p['cover_files']),GLOB_BRACE)) { dfm("Album files and cover found, processing ".$pathname." with flacdiricon");