0.8.0.2
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
# Changelog
|
||||
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
|
||||
- Output redirection fixes
|
||||
- Thumbnail bindings
|
||||
- "Add to existing" prefs option
|
||||
|
||||
## [0.8.0.1]
|
||||
- Move batchfile generation to Prescan
|
||||
- Rewrite batchfile generation (batch now handles files, links, dirs)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Yuba** generates web-browsable catalogues from locally attached HFS+ filesystems. Its client application gathers forensic-quality data about a volume, properly interpreting bundles, reading Spotlight data, Finder flags, labels, and other contextual information. It can generate hashes, thumbnails, and gather 3rd party metadata with exiftool and mediainfo. Yuba's SQLite catalogues are comprehensive, lightweight, optimized for massive (1 million+) trees, and reflect incremental changes to contents and metadata. A server-side PHP script is provided, which allows familiar, Finder-style browsing of a catalogue.
|
||||
|
||||
####[⇩ Download Yuba 0.8.0.1](https://www.profiteroles.org/git/p/Yuba/raw/master/Yuba.app.zip) ([Changelog](CHANGELOG.md))
|
||||
####[⇩ Download Yuba 0.8.0.2](https://www.profiteroles.org/git/p/Yuba/raw/master/Yuba.app.zip) ([Changelog](CHANGELOG.md))
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
BIN
Tester.zip
BIN
Tester.zip
Binary file not shown.
@@ -44,6 +44,9 @@ mkdir($wprefix);
|
||||
|
||||
if ($mode == "thumb") {
|
||||
|
||||
$cmd['ql-thumbnail'][] = $bin_qlthumb." ".$shellpath." ".$tprefix."ql-thumbnail.jpg public.jpeg ".$p['thumb_size']." ".$p['thumb_size']." .8";
|
||||
$cmd['ql-thumbnail'][] = $tprefix."ql-thumbnail.jpg";
|
||||
|
||||
$cmd['sips'][] = $bin_sips." -s format jpeg -s formatOptions 80 -Z ".$p['thumb_size']." ".$shellpath." --out ".$tprefix."sips.jpg"; // add ?? "-d profile --deleteColorManagementProperties"
|
||||
$cmd['sips'][] = $tprefix."sips.jpg";
|
||||
|
||||
@@ -59,18 +62,21 @@ if ($mode == "thumb") {
|
||||
$cmd['qlmanage'][] = $bin_qlmanage." -t -s ".$p['thumb_size']." -o ".$wprefix." ".$shellpath." ; mv ".escapeshellarg($wprefix.basename($argv[2]).".png")." ".$tprefix."qlmanage.png";
|
||||
$cmd['qlmanage'][] = $tprefix."qlmanage.png";
|
||||
|
||||
$cmd['ql-thumbnail'][] = $bin_qlthumb." ".$shellpath." ".$tprefix."qlthumb.jpg public.jpeg ".$p['thumb_size']." ".$p['thumb_size']." .8";
|
||||
$cmd['ql-thumbnail'][] = $tprefix."qlthumb.jpg";
|
||||
|
||||
$cmd['sox_q'][] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -o - | ".$bin_pngquant." - -o ".$tprefix."sox-quant.png";
|
||||
$cmd['sox_q'][] = $tprefix."sox-quant.png";
|
||||
|
||||
$cmd['sox_c'][] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -o - | ".$bin_convert." - -quality 85% ".$tprefix."sox-convert.jpg";
|
||||
$cmd['sox_c'][] = $tprefix."sox-convert.jpg";
|
||||
|
||||
$cmd['sox_cx'][] = $bin_sox." ".$shellpath." -n remix - trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -r -o - | ".$bin_convert." - -quality 85% ".$tprefix."sox-convert_x.jpg";
|
||||
$cmd['sox_cx'][] = $bin_sox." ".$shellpath." -n remix - trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/20}') spectrogram -r -o - | ".$bin_convert." - -quality 85% ".$tprefix."sox-convert_x.jpg";
|
||||
$cmd['sox_cx'][] = $tprefix."sox-convert_x.jpg";
|
||||
|
||||
$cmd['sox_cy'][] = $bin_sox." ".$shellpath." -n remix - trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/4}') spectrogram -r -o - | ".$bin_convert." - -quality 85% ".$tprefix."sox-convert_y.jpg";
|
||||
$cmd['sox_cy'][] = $tprefix."sox-convert_y.jpg";
|
||||
|
||||
$cmd['sox_cz'][] = $bin_sox." ".$shellpath." -n remix - spectrogram -r -o - | ".$bin_convert." - -quality 85% ".$tprefix."sox-convert_all.jpg";
|
||||
$cmd['sox_cz'][] = $tprefix."sox-convert_all.jpg";
|
||||
|
||||
$cmd['sox_s'][] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/10}') spectrogram -o ".escapeshellarg($wprefix.basename($argv[2]).".png")."; ".$bin_sips." -s format jpeg -s formatOptions 80 ".escapeshellarg($wprefix.basename($argv[2]).".png")." --out ".$tprefix."sox-sips.jpg";
|
||||
$cmd['sox_s'][] = $tprefix."sox-sips.jpg";
|
||||
|
||||
@@ -82,23 +88,23 @@ if ($mode == "thumb") {
|
||||
$cmd['qltool'][] = $bin_qltool." di ".$shellpath." ".$p['icon_size']." ".$p['icon_size']." | base64 --decode | ".$bin_convert." - -scale 50% -strip -define png:compression-level=9 ".$tprefix."qltool.png";
|
||||
$cmd['qltool'][] = $tprefix."qltool.png";
|
||||
|
||||
$cmd['qltool_q'][] = $bin_qltool." di ".$shellpath." ".$p['icon_size']." ".$p['icon_size']." | base64 --decode | ".$bin_convert." - -scale 50% - | ".$bin_pngquant." - -o ".$tprefix."qltool-quant.png";
|
||||
$cmd['qltool_q'][] = $tprefix."qltool-quant.png";
|
||||
$cmd['qltool_q'][] = $bin_qltool." di ".$shellpath." ".$p['icon_size']." ".$p['icon_size']." | base64 --decode | ".$bin_convert." - -scale 50% - | ".$bin_pngquant." - -o ".$tprefix."qltool_quant.png";
|
||||
$cmd['qltool_q'][] = $tprefix."qltool_quant.png";
|
||||
|
||||
$cmd['ql-icon'][] = $bin_qlicon." --input=".$shellpath." --width=".$p['icon_size']." --height=".$p['icon_size']." --output=".$tprefix."qlicon.png";
|
||||
$cmd['ql-icon'][] = $tprefix."qlicon.png";
|
||||
$cmd['ql-icon'][] = $bin_qlicon." --input=".$shellpath." --width=".$p['icon_size']." --height=".$p['icon_size']." --output=".$tprefix."ql-icon.png";
|
||||
$cmd['ql-icon'][] = $tprefix."ql-icon.png";
|
||||
|
||||
$cmd['ql-icon_q'][] = $bin_qlicon." --input=".$shellpath." --width=".$p['icon_size']." --height=".$p['icon_size']." | ".$bin_pngquant." - -o ".$tprefix."qlicon-quant.png";
|
||||
$cmd['ql-icon_q'][] = $tprefix."qlicon-quant.png";
|
||||
$cmd['ql-icon_q'][] = $bin_qlicon." --input=".$shellpath." --width=".$p['icon_size']." --height=".$p['icon_size']." | ".$bin_pngquant." - -o ".$tprefix."ql-icon_quant.png";
|
||||
$cmd['ql-icon_q'][] = $tprefix."ql-icon_quant.png";
|
||||
|
||||
$cmd['qlmanage_sx'][] = $bin_qlmanage." -ti -s ".$p['icon_size']." -o ".$wprefix." ".$shellpath." ; mv ".escapeshellarg($wprefix.basename($argv[2]).".png")." ".$tprefix."qlmanage-size.png";
|
||||
$cmd['qlmanage_sx'][] = $tprefix."qlmanage-size.png";
|
||||
$cmd['qlmanage_sx'][] = $bin_qlmanage." -ti -s ".$p['icon_size']." -o ".$wprefix." ".$shellpath." ; mv ".escapeshellarg($wprefix.basename($argv[2]).".png")." ".$tprefix."qlmanage_size.png";
|
||||
$cmd['qlmanage_sx'][] = $tprefix."qlmanage_size.png";
|
||||
|
||||
$cmd['qlmanage_fx'][] = $bin_qlmanage." -ti -f ".floor($p['icon_size']/128)." -o ".$wprefix." ".$shellpath." ; mv ".escapeshellarg($wprefix.basename($argv[2]).".png")." ".$tprefix."qlmanage-multiplier.png";
|
||||
$cmd['qlmanage_fx'][] = $tprefix."qlmanage-multiplier.png";
|
||||
$cmd['qlmanage_fx'][] = $bin_qlmanage." -ti -f ".floor($p['icon_size']/128)." -o ".$wprefix." ".$shellpath." ; mv ".escapeshellarg($wprefix.basename($argv[2]).".png")." ".$tprefix."qlmanage_multiplier.png";
|
||||
$cmd['qlmanage_fx'][] = $tprefix."qlmanage_multiplier.png";
|
||||
|
||||
$cmd['qlmanage_zx'][] = $bin_qlmanage." -ti -F ".floor($p['icon_size']/64)." -o ".$wprefix." ".$shellpath." ; sips -z ".$p['icon_size']." ".$p['icon_size']." ".escapeshellarg($wprefix.basename($argv[2]).".png")." --out ".$tprefix."qlmanage-multiplier_large.png";
|
||||
$cmd['qlmanage_zx'][] = $tprefix."qlmanage-multiplier_large.png";
|
||||
$cmd['qlmanage_zx'][] = $bin_qlmanage." -ti -F ".floor($p['icon_size']/64)." -o ".$wprefix." ".$shellpath." ; sips -z ".$p['icon_size']." ".$p['icon_size']." ".escapeshellarg($wprefix.basename($argv[2]).".png")." --out ".$tprefix."qlmanage_multiplierlarge.png";
|
||||
$cmd['qlmanage_zx'][] = $tprefix."qlmanage_multiplierlarge.png";
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +114,7 @@ foreach ($cmd as $exec) {
|
||||
$start = microtime(true);
|
||||
echo $exec[0]."\n";
|
||||
shell_exec($exec[0]);
|
||||
$elapsed = substr((microtime(true)-$start),2,3);
|
||||
$elapsed = substr((microtime(true)-$start),0,4);
|
||||
|
||||
$ext = pathinfo($exec[1], PATHINFO_EXTENSION);
|
||||
$file = pathinfo($exec[1], PATHINFO_FILENAME);
|
||||
|
||||
BIN
Yuba.app.zip
BIN
Yuba.app.zip
Binary file not shown.
48
Yuba.php
48
Yuba.php
@@ -38,7 +38,6 @@ require("filetypes.php");
|
||||
$wopt_steps = 7; // total number of steps
|
||||
$wopt_currstep = 1;
|
||||
if ($p['debug']) { $wopt_clear = 0; } else { $wopt_clear = 1; }
|
||||
$wopt_debug_unique = 0;
|
||||
|
||||
$parser = new plistParser();
|
||||
|
||||
@@ -103,7 +102,7 @@ if (!is_dir($bdest)) { if (!mkdir($bdest,0777,true)) { echo "Error creating dest
|
||||
|
||||
// Check for bundle
|
||||
if ($zpath == "/") { $blabel = "root"; } else { $blabel = preg_replace("/[^A-Za-z0-9\.]/", "_", basename($zpath)); }
|
||||
if ($wopt_debug_unique) { $blabel .= "-".$mytime; }
|
||||
if (!$p['reuse']) { $blabel .= "-".$mytime; }
|
||||
if (is_writable($zpath)) { echo "Warning: source is writeable\n"; }
|
||||
|
||||
$bpath = chop($bdest,"/")."/".substr(crc32($zpath),0,3)."_".$blabel.".bundle";
|
||||
@@ -228,10 +227,10 @@ $dbo = new PDO("sqlite:".$bpath."/".$stamp.".sqlite3");
|
||||
$dbo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$dbo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
|
||||
//$dbo->query("PRAGMA page_size = 4096");
|
||||
//$dbo->query("PRAGMA cache_size = 10000");
|
||||
//$dbo->query("PRAGMA locking_mode = EXCLUSIVE");
|
||||
//$dbo->query("PRAGMA synchronous = NORMAL");
|
||||
$dbo->query("PRAGMA page_size = 4096");
|
||||
$dbo->query("PRAGMA cache_size = 10000");
|
||||
$dbo->query("PRAGMA synchronous = NORMAL");
|
||||
$dbo->query("PRAGMA locking_mode = NORMAL");
|
||||
$dbo->query("PRAGMA journal_mode = WAL");
|
||||
|
||||
$dbo->exec("CREATE TABLE _skim (
|
||||
@@ -399,20 +398,6 @@ if (!$passed_total) {
|
||||
|
||||
echo msg("Total files: ".$passed_total."");
|
||||
|
||||
// Pool DB
|
||||
//////////////////////////////////////////
|
||||
|
||||
$dbp = new PDO("sqlite:".$bpath."/pool.sqlite3");
|
||||
|
||||
$dbp->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS md5 (fid TEXT, hash TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS exiftool (fid TEXT, tags TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS mediainfo (fid TEXT, info TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS thumbs (fid TEXT, created INTEGER, relative_path TEXT, width INTEGER, height INTEGER, tool TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS icons (fid TEXT, hash TEXT, created INTEGER, relative_path TEXT, tool TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS contents (fid TEXT, created INTEGER, relative_path TEXT)");
|
||||
|
||||
// Prescan
|
||||
//////////////////////////////////////////
|
||||
|
||||
@@ -488,6 +473,7 @@ foreach ($files as $splFileInfo) {
|
||||
$parts[] = $splFileInfo->getType();
|
||||
$parts[] = escapeshellarg($bpath);
|
||||
$parts[] = $mytime;
|
||||
$parts[] = $p['spotlight'];
|
||||
|
||||
$tcmd = implode(" ",$parts);
|
||||
//msg($tcmd);
|
||||
@@ -598,6 +584,26 @@ $wopt_currstep++;
|
||||
|
||||
if ($p['spotlight']) { $dbo->exec("CREATE TABLE mdls (id INTEGER PRIMARY KEY,".implode(",",$cbuild).")"); }
|
||||
|
||||
// Pool DB
|
||||
//////////////////////////////////////////
|
||||
|
||||
$dbp = new PDO("sqlite:".$bpath."/pool.sqlite3");
|
||||
|
||||
$dbp->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$dbp->query("PRAGMA page_size = 4096");
|
||||
$dbp->query("PRAGMA cache_size = 10000");
|
||||
$dbp->query("PRAGMA synchronous = NORMAL");
|
||||
$dbp->query("PRAGMA locking_mode = NORMAL");
|
||||
$dbp->query("PRAGMA journal_mode = WAL");
|
||||
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS md5 (fid TEXT, hash TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS exiftool (fid TEXT, tags TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS mediainfo (fid TEXT, info TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS thumbs (fid TEXT, created INTEGER, relative_path TEXT, width INTEGER, height INTEGER, tool TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS icons (fid TEXT, hash TEXT, created INTEGER, relative_path TEXT, tool TEXT)");
|
||||
$dbp->exec("CREATE TABLE IF NOT EXISTS contents (fid TEXT, created INTEGER, relative_path TEXT)");
|
||||
|
||||
// Helper
|
||||
//////////////////////////////////////////
|
||||
|
||||
@@ -625,8 +631,6 @@ $dbp->exec("CREATE INDEX IF NOT EXISTS mediainfo_index ON mediainfo (fid)");
|
||||
$dbp->exec("CREATE INDEX IF NOT EXISTS thumbs_index ON thumbs (fid)");
|
||||
$dbp->exec("CREATE INDEX IF NOT EXISTS icons_index ON icons (fid)");
|
||||
|
||||
$dbo->exec("CREATE INDEX IF NOT EXISTS mdls_index ON mdls (id)");
|
||||
|
||||
// Files
|
||||
//////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ function makeWindowString($p, $strings) {
|
||||
bdest.default = ".$p['bdest']."
|
||||
bdest.width = 380
|
||||
|
||||
reuse.type = checkbox
|
||||
reuse.label = Add to existing catalogs
|
||||
reuse.default = ".$p['reuse']."
|
||||
|
||||
postflight.type = popup
|
||||
postflight.label = When finished
|
||||
postflight.option = ".$strings[0][0]."
|
||||
@@ -91,7 +95,6 @@ function makeWindowString($p, $strings) {
|
||||
thumb_mode.label = Mode
|
||||
thumb_mode.option = ".$strings[3][0]."
|
||||
thumb_mode.option = ".$strings[3][1]."
|
||||
thumb_mode.option = ".$strings[3][2]."
|
||||
thumb_mode.default = ".$strings[3][$p['thumb_mode']]."
|
||||
thumb_mode.width = 120
|
||||
thumb_mode.x = 150
|
||||
@@ -210,7 +213,7 @@ if(!$p['bdest']) {
|
||||
$strings[] = array("Do nothing","Reveal result in Finder","Upload result with rsync","Open via localhost URL");
|
||||
$strings[] = array("Skip","Collect","Collect & verify","Collect & repair atimes");
|
||||
$strings[] = array("Skip","Generate","Rebuild");
|
||||
$strings[] = array("All files","Most files","Some files");
|
||||
$strings[] = array("Most files","Some files");
|
||||
$strings[] = array("All files","Most files","Some files");
|
||||
|
||||
// Launch Pashua and parse results
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.8.0.1
|
||||
0.8.0.2
|
||||
118
filetypes.php
118
filetypes.php
@@ -19,9 +19,9 @@ $bin_flacicon = escapeshellarg(__DIR__."/bin/flacicon");
|
||||
$bin_flacdiricon = escapeshellarg(__DIR__."/bin/flacdiricon");
|
||||
|
||||
// System tools
|
||||
$bin_php = "php";
|
||||
$bin_qlmanage = "qlmanage";
|
||||
$bin_sips = "sips";
|
||||
$bin_php = "/usr/bin/php";
|
||||
$bin_qlmanage = "/usr/bin/qlmanage";
|
||||
$bin_sips = "/usr/bin/sips";
|
||||
|
||||
// External tools
|
||||
$bin_vips = "/opt/local/bin/vipsthumbnail";
|
||||
@@ -76,51 +76,59 @@ $p['c_files'] = array( "DS_Store",
|
||||
"doc",
|
||||
"docx" );
|
||||
|
||||
// Use ffmpeg to generate thumbnails for these files
|
||||
$p['t_files']['ffmpeg'] = array( "mkv",
|
||||
"avi",
|
||||
"mpeg",
|
||||
"mpg",
|
||||
"vob",
|
||||
"mp4",
|
||||
"m4v",
|
||||
"m2v",
|
||||
"m2ts",
|
||||
"asf",
|
||||
"wmv",
|
||||
"rm",
|
||||
"divx",
|
||||
"fla",
|
||||
"flv",
|
||||
"webm" );
|
||||
// Thumbnail bindings
|
||||
|
||||
$p['t_b']['mkv'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['avi'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['mpeg'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['mpg'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['vob'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['mp4'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['m4v'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['m2v'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['m2ts'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['asf'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['wmv'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['rm'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['divx'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['fla'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['flv'] = array("ql-thumbnail","ffmpeg");
|
||||
$p['t_b']['webm'] = array("ql-thumbnail","ffmpeg");
|
||||
|
||||
// Use sips to generate thumbnails for these files
|
||||
// SIPS does not currently support JPEG Orientation EXIF Tag,
|
||||
// so images will sometimes appear sideways
|
||||
//$p['t_files']['sips'] = array( "jpg",
|
||||
// "jpeg",
|
||||
// "tif",
|
||||
// "tiff",
|
||||
// "gif",
|
||||
// "psd",
|
||||
// "png",
|
||||
// "heic",
|
||||
// "pdf",
|
||||
// "ai",
|
||||
// "ps",
|
||||
// "bmp",
|
||||
// "pict",
|
||||
// "jp2" );
|
||||
$p['t_b']['jpg'] = array("sips","ql-thumbnail","vips");
|
||||
$p['t_b']['jpeg'] = array("sips","ql-thumbnail","vips");
|
||||
$p['t_b']['png'] = array("sips","ql-thumbnail","vips");
|
||||
|
||||
// Use sox to generate thumbnails for these files
|
||||
$p['t_files']['sox'] = array( "flac",
|
||||
"wav",
|
||||
"aif",
|
||||
"aiff" );
|
||||
$p['t_b']['tif'] = array("vips","sips","ql-thumbnail");
|
||||
$p['t_b']['tiff'] = array("vips","sips","ql-thumbnail");
|
||||
|
||||
// Don't make thumbnails for these files
|
||||
$p['t_skip'] = array( "emlx",
|
||||
"DS_Store" );
|
||||
$p['t_b']['nik'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['dng'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['gif'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['psd'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['heic'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['pdf'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['ai'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['ps'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['bmp'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['pict'] = array("ql-thumbnail","sips","vips");
|
||||
$p['t_b']['jp2'] = array("ql-thumbnail","sips","vips");
|
||||
|
||||
$p['t_b']['flac'] = array("sox");
|
||||
$p['t_b']['wav'] = array("sox");
|
||||
$p['t_b']['aif'] = array("sox");
|
||||
$p['t_b']['aiff'] = array("sox");
|
||||
$p['t_b']['au'] = array("sox");
|
||||
$p['t_b']['wv'] = array("sox");
|
||||
$p['t_b']['snd'] = array("sox");
|
||||
$p['t_b']['voc'] = array("sox");
|
||||
|
||||
$p['t_b']['mp3'] = array("sox","ql-thumbnail");
|
||||
$p['t_b']['m4a'] = array("sox","ql-thumbnail");
|
||||
$p['t_b']['m4b'] = array("sox","ql-thumbnail");
|
||||
$p['t_b']['ogg'] = array("sox","ql-thumbnail");
|
||||
|
||||
$p['t_b']['*'] = "ql-thumbnail";
|
||||
|
||||
// Don't make icons for these files
|
||||
$p['i_skip'] = array( "jpg",
|
||||
@@ -136,6 +144,16 @@ $p['i_skip'] = array( "jpg",
|
||||
"aif",
|
||||
"zip",
|
||||
"DS_Store" );
|
||||
|
||||
// Make sox preview icons for these files
|
||||
$p['i_sox'] = array( "flac",
|
||||
"wav",
|
||||
"aif",
|
||||
"aiff",
|
||||
"au",
|
||||
"wv",
|
||||
"snd",
|
||||
"voc" );
|
||||
|
||||
// Run mediainfo on these files
|
||||
$p['m_files'] = array( "mkv",
|
||||
@@ -240,10 +258,8 @@ foreach ($p['bundles'] as $bundle) { $p['nodescend'][] = "*.".$bundle; }
|
||||
foreach ($p['c_files'] as $ext) { $p['c_files'][] = strtoupper($ext); }
|
||||
foreach ($p['e_files'] as $ext) { $p['e_files'][] = strtoupper($ext); }
|
||||
foreach ($p['m_files'] as $ext) { $p['m_files'][] = strtoupper($ext); }
|
||||
foreach ($p['t_files']['ffmpeg'] as $ext) { $p['t_files']['ffmpeg'][] = strtoupper($ext); }
|
||||
//foreach ($p['t_files']['sips'] as $ext) { $p['t_files']['sips'][] = strtoupper($ext); }
|
||||
foreach ($p['t_skip'] as $ext) { $p['t_skip'][] = strtoupper($ext); }
|
||||
foreach ($p['i_skip'] as $ext) { $p['i_skip'][] = strtoupper($ext); }
|
||||
foreach ($p['i_sox'] as $ext) { $p['i_sox'][] = strtoupper($ext); }
|
||||
foreach ($p['p_files'] as $file) { $p['p_files'][] = strtoupper($file); }
|
||||
|
||||
// Spotlight //////////////////////////////////////////
|
||||
@@ -289,4 +305,10 @@ foreach (array_merge($mb['t'],$mb['a']) as $item) {
|
||||
|
||||
unset($item);
|
||||
|
||||
// Album dirs //////////////////////////////////////////
|
||||
|
||||
$p['album_files'] = array("flac","mp3","mp4","wav","ogg","aiff","aif");
|
||||
$p['cover_files'] = array("cover","folder","front","dir");
|
||||
$p['cover_exts'] = array("jpg","jpeg","png");
|
||||
|
||||
?>
|
||||
@@ -76,6 +76,33 @@ class ProgressBar {
|
||||
// Functions
|
||||
//////////////////////////////////////////
|
||||
|
||||
function globext($array) {
|
||||
$globparts = array();
|
||||
foreach ($array as $ext) {
|
||||
$globstring = "";
|
||||
$parts = str_split($ext);
|
||||
foreach ($parts as $char) {
|
||||
$globstring .= "[".$char.strtoupper($char)."]";
|
||||
}
|
||||
$globparts[] = $globstring;
|
||||
}
|
||||
return "{".implode(",",$globparts)."}";
|
||||
}
|
||||
|
||||
function globstring($array,$base = "*") {
|
||||
if (!is_array($base)) {
|
||||
return $base.".".globext($array);
|
||||
} else {
|
||||
$globparts = array();
|
||||
foreach ($base as $file) {
|
||||
$globparts[] = $file;
|
||||
$globparts[] = strtoupper($file);
|
||||
$globparts[] = ucfirst($file);
|
||||
}
|
||||
return "{".implode(",",$globparts)."}".".".globext($array);
|
||||
}
|
||||
}
|
||||
|
||||
function revise_prefs($array) { // bad practice
|
||||
$prefs_file = "/Users/".get_current_user()."/Library/Preferences/org.profiteroles.Yuba.php";
|
||||
$p = unserialize(file_get_contents($prefs_file));
|
||||
@@ -182,7 +209,7 @@ function shortlabel($pathname, $max = 99) {
|
||||
} else {
|
||||
$return = $basename;
|
||||
}
|
||||
return $return;
|
||||
return str_replace("\r","",$return); // filter out weird carriage returns in Icon filenames
|
||||
}
|
||||
|
||||
function human_filesize($bytes, $decimals = 2) {
|
||||
|
||||
129
helper.php
129
helper.php
@@ -13,9 +13,6 @@ $p = unserialize(file_get_contents($prefs_file));
|
||||
require("functions.php");
|
||||
require("filetypes.php");
|
||||
|
||||
$redirect = "2>&1";
|
||||
//$redirect = "2> /tmp/yuba/debug.log";
|
||||
|
||||
$dm = "";
|
||||
function dfm ($string, $flag = 0) {
|
||||
// dumb workaround for debug messages appearing out of order
|
||||
@@ -39,6 +36,7 @@ $pathname = $argv[4];
|
||||
$pid = md5($pathname);
|
||||
$shellpath = escapeshellarg($pathname);
|
||||
$ext = pathinfo($pathname,PATHINFO_EXTENSION);
|
||||
$extl = strtolower($ext);
|
||||
$file = pathinfo($pathname, PATHINFO_BASENAME);
|
||||
$btype = $argv[5];
|
||||
$bpath = $argv[6];
|
||||
@@ -48,6 +46,13 @@ $parser = new plistParser();
|
||||
|
||||
$stamp = date("Y-m-d_H-i-s", $mytime);
|
||||
$messages_log_file = $bpath."/".$stamp."_messages.log";
|
||||
$error_log_file = $bpath."/".$stamp."_error.log";
|
||||
|
||||
if ($p['debug']) {
|
||||
$redirect = "2>&1 | tee -a /tmp/yuba/debug.log";
|
||||
} else {
|
||||
$redirect = "2>> ".$error_log_file;
|
||||
}
|
||||
|
||||
$tmpdir = "/tmp/yuba/".$mytime;
|
||||
if (!is_dir($tmpdir)) { mkdir($tmpdir,0777,true); dfm("mkdir ",$tmpdir); }
|
||||
@@ -58,10 +63,10 @@ $dbo = new PDO("sqlite:".$bpath."/".$stamp.".sqlite3");
|
||||
$dbo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$dbo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
|
||||
//$dbo->query("PRAGMA page_size = 4096");
|
||||
//$dbo->query("PRAGMA cache_size = 10000");
|
||||
//$dbo->query("PRAGMA locking_mode = EXCLUSIVE");
|
||||
//$dbo->query("PRAGMA synchronous = NORMAL");
|
||||
$dbo->query("PRAGMA page_size = 4096");
|
||||
$dbo->query("PRAGMA cache_size = 10000");
|
||||
$dbo->query("PRAGMA synchronous = NORMAL");
|
||||
$dbo->query("PRAGMA locking_mode = NORMAL");
|
||||
$dbo->query("PRAGMA journal_mode = WAL");
|
||||
|
||||
// Pool DB
|
||||
@@ -70,10 +75,10 @@ $dbp = new PDO("sqlite:".$bpath."/pool.sqlite3");
|
||||
$dbp->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$dbp->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
|
||||
//$dbp->query("PRAGMA page_size = 4096");
|
||||
//$dbp->query("PRAGMA cache_size = 10000");
|
||||
//$dbp->query("PRAGMA locking_mode = EXCLUSIVE");
|
||||
//$dbp->query("PRAGMA synchronous = NORMAL");
|
||||
$dbp->query("PRAGMA page_size = 4096");
|
||||
$dbp->query("PRAGMA cache_size = 10000");
|
||||
$dbp->query("PRAGMA synchronous = NORMAL");
|
||||
$dbo->query("PRAGMA locking_mode = NORMAL");
|
||||
$dbp->query("PRAGMA journal_mode = WAL");
|
||||
|
||||
$sbatch = array();
|
||||
@@ -91,10 +96,11 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") {
|
||||
|
||||
$estring .= " THUMBS";
|
||||
|
||||
// "bad" filesizes from generic icons
|
||||
// "bad" filesizes from generic audio file icons
|
||||
$discard = array( 3953,
|
||||
4977,
|
||||
5019,
|
||||
7133,
|
||||
6059,
|
||||
6616,
|
||||
17393 );
|
||||
@@ -105,10 +111,10 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") {
|
||||
|
||||
if (!is_dir(dirname($tfile))) { @mkdir(dirname($tfile),0777,true); dfm("mkdir ".dirname($tfile)); }
|
||||
|
||||
if ($p['thumb_mode'] != 0 && in_array($ext, $p['t_skip'])) {
|
||||
if ($ext == "DS_Store") {
|
||||
// file extension is in the skip list
|
||||
$estring .= " ->t_skip";
|
||||
dfm("file extension is in the skip list");
|
||||
dfm("skipping ds_store");
|
||||
goto icons;
|
||||
}
|
||||
|
||||
@@ -152,41 +158,47 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") {
|
||||
$cmd['vips'] = $bin_vips." ".$shellpath." -o ".$tfile."[Q=90,optimize_coding] --size=".$p['thumb_size'];
|
||||
|
||||
$cmd['sox'] = $bin_sox." ".$shellpath." -n trim 0 $(".$bin_exiftool." -s -s -s -duration# ".$shellpath." | awk '{print $1/4}') spectrogram -r -o - | ".$bin_convert." - -quality 85% ".$tfile;
|
||||
$cmd['ffmpeg'] = $bin_ffmpeg." -ss $(( $(".$bin_mediainfo." --Inform='Video;%Duration%' ".$shellpath." | cut -d'.' -f1) / 10000 )) -i ".$shellpath." -vframes 1 -filter:v scale='400:-1' -q:v 3 ".$tfile;
|
||||
$cmd['ffmpeg'] = $bin_ffmpeg." -ss $(( $(".$bin_mediainfo." --Inform='Video;%Duration%' ".$shellpath." | cut -d'.' -f1) / 10000 )) -i ".$shellpath." -vframes 1 -filter:v scale='".$p['thumb_size'].":-1' -q:v 3 ".$tfile;
|
||||
|
||||
$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;
|
||||
|
||||
$external_tool = null;
|
||||
foreach ($p['t_files'] as $tool => $whitelist) {
|
||||
if (in_array($ext, $whitelist)) {
|
||||
$external_tool = $tool;
|
||||
}
|
||||
}
|
||||
dfm("external tool for ".$ext." = ".$external_tool);
|
||||
switch ($p['thumb_mode']) {
|
||||
case 0: $priority = array($external_tool,"ql-thumbnail","qlmanage"); break;
|
||||
case 1: $priority = array("ql-thumbnail","qlmanage"); break;
|
||||
case 2: $priority = array("ql-thumbnail"); break;
|
||||
case 0: // most files
|
||||
if (!empty($p['t_b'][$extl])) {
|
||||
$priority = $p['t_b'][$extl];
|
||||
} else {
|
||||
$priority = $p['t_b']['*'];
|
||||
}
|
||||
break;
|
||||
case 1: // some files
|
||||
if (!empty($p['t_b'][$extl]) && !in_array($p['t_b']['*'],$p['t_b'][$extl])) {
|
||||
$priority = $p['t_b']['*'];
|
||||
} else {
|
||||
$priority = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
dfm("thumb mode ".$p['thumb_mode']);
|
||||
dfm("priority for ".$ext." is: ".print_r($priority,true));
|
||||
dfm("priority for ".$extl." is: ".print_r($priority,true));
|
||||
|
||||
$stmt->BindValue(":fid",$fid);
|
||||
$stmt->BindValue(":created",time());
|
||||
|
||||
if (!is_array($priority)) { $priority = array($priority); }
|
||||
|
||||
foreach ($priority as $tool) {
|
||||
|
||||
if (empty($cmd[$tool])) { continue; }
|
||||
|
||||
dfm($cmd[$tool]);
|
||||
shell_exec($cmd[$tool]." 2>1");
|
||||
shell_exec("( ".$cmd[$tool]." ) ".$redirect);
|
||||
$estring .= " ->".$tool;
|
||||
|
||||
$checksize = @filesize($tfile);
|
||||
if ($checksize) {
|
||||
if (!empty($discard) && in_array($checksize,$discard)) {
|
||||
$estring .= " ->discard";
|
||||
if (in_array($checksize,$discard)) {
|
||||
$estring .= " ->bdiscard";
|
||||
dfm($checksize." is in the banned size array");
|
||||
} else {
|
||||
$estring .= " ->use";
|
||||
@@ -204,7 +216,7 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") {
|
||||
}
|
||||
} else {
|
||||
$estring .= " ->discard";
|
||||
dfm($tool." produced a bad file (size=".$checksize.")");
|
||||
dfm($tool." did not produce a file");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -218,13 +230,14 @@ if ($p['thumbs'] && $btype == "file" && $ext != "DS_Store") {
|
||||
// Icons //////////////////////////////////////////
|
||||
|
||||
icons:
|
||||
if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store") {
|
||||
|
||||
//if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store") {
|
||||
if ($p['icons'] && $ext != "DS_Store") {
|
||||
|
||||
dfm("ICONS",1);
|
||||
|
||||
$estring .= " ICONS";
|
||||
|
||||
if ($p['icon_mode'] != 0 && in_array($ext, $p['i_skip'])) {
|
||||
if ($p['icon_mode'] != 0 && in_array($extl, $p['i_skip'])) {
|
||||
$estring .= " ->i_skip";
|
||||
dfm("file extension is in the skip list");
|
||||
goto meta;
|
||||
@@ -257,7 +270,6 @@ if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store")
|
||||
|
||||
}
|
||||
|
||||
$cmd['flacdiricon'] = $bin_flacdiricon." ".$shellpath." ".$p['icon_size']." ".$tfile;
|
||||
$cmd['flacicon'] = $bin_flacicon." ".$shellpath." ".$p['icon_size']." ".$tfile;
|
||||
$cmd['ql-icon'] = $bin_qlicon." --input=".$shellpath." --width=".$p['icon_size']." --height=".$p['icon_size']." | ".$bin_pngquant." - -o ".$tfile;
|
||||
$cmd['qltool'] = $bin_qltool." di ".$shellpath." ".$p['icon_size']." ".$p['icon_size']." | base64 --decode | ".$bin_convert." - -scale 50% - | ".$bin_pngquant." - -o ".$tfile;
|
||||
@@ -266,7 +278,7 @@ if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store")
|
||||
|
||||
dfm("icon mode 2, bypassing hash check");
|
||||
$tool = "ql-icon";
|
||||
shell_exec($cmd[$tool]." ".$redirect);
|
||||
shell_exec("( ".$cmd[$tool]." ) ".$redirect);
|
||||
$stmt->BindValue(":tool",$tool);
|
||||
dfm($cmd[$tool]);
|
||||
$estring .= " ->".$tool;
|
||||
@@ -289,22 +301,39 @@ if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store")
|
||||
|
||||
} else {
|
||||
|
||||
$gfind = array("[","]","{","}");
|
||||
$greplace = array("\[","\]","\{","\}");
|
||||
$globsafe = str_replace($gfind,$greplace,$pathname);
|
||||
|
||||
if ($btype == "dir") {
|
||||
dfm($pathname." is a dir, proceeding with directory check");
|
||||
$stmt->BindValue(":fid",$pid);
|
||||
$tools = array("flacdiricon","qltool");
|
||||
if (file_exists($pathname."/Icon\r")) {
|
||||
dfm("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");
|
||||
$cmd['flacdiricon'] = $bin_flacdiricon." ".$shellpath." ".$p['icon_size']." ".escapeshellarg(array_shift($test))." ".$tfile;
|
||||
$tools = array("flacdiricon");
|
||||
} else {
|
||||
dfm("glob ".$pathname."/".globstring($p['album_files']));
|
||||
dfm("glob ".$pathname."/".globstring($p['cover_exts'],$p['cover_files']));
|
||||
dfm("Nothing found, skipping ".$pathname);
|
||||
$tools = array();
|
||||
}
|
||||
} else {
|
||||
$stmt->BindValue(":fid",$fid);
|
||||
if ($ext == "flac") {
|
||||
if (in_array($extl, $p['i_sox'])) {
|
||||
$tools = array("flacicon","ql-icon","qltool");
|
||||
} else {
|
||||
$tools = array("ql-icon","qltool");
|
||||
}
|
||||
}
|
||||
|
||||
unset($mytool);
|
||||
$mytool = "";
|
||||
foreach ($tools as $tool) {
|
||||
if (!@filesize($tfile)) {
|
||||
shell_exec($cmd[$tool]." ".$redirect);
|
||||
shell_exec("( ".$cmd[$tool]." ) ".$redirect);
|
||||
dfm($cmd[$tool]);
|
||||
$estring .= " ->".$tool;
|
||||
$mytool = $tool;
|
||||
@@ -347,8 +376,12 @@ if ($p['icons'] && ($btype == "file" || $btype == "dir") && $ext != "DS_Store")
|
||||
|
||||
} else {
|
||||
|
||||
$estring .= " ->discard";
|
||||
dfm($mytool." produced a bad file (size=".$checksize.")");
|
||||
if (empty($tools)) {
|
||||
$estring .= " ->gskip";
|
||||
} else {
|
||||
$estring .= " ->discard";
|
||||
}
|
||||
dfm("tool = ".$mytool." produced a bad file (size=".$checksize.")");
|
||||
|
||||
}
|
||||
|
||||
@@ -369,13 +402,13 @@ if ($p['meta'] && $btype == "file" && $ext != "DS_Store") {
|
||||
|
||||
$estring .= " META";
|
||||
|
||||
if (!in_array($ext, $p['e_files']) && !in_array($ext, $p['m_files'])) {
|
||||
if (!in_array($extl, $p['e_files']) && !in_array($extl, $p['m_files'])) {
|
||||
$estring .= " ->notmedia";
|
||||
dfm("file extension ".$ext." is not a media file");
|
||||
dfm("file extension ".$extl." is not a media file");
|
||||
goto hashy;
|
||||
}
|
||||
|
||||
if (in_array($ext, $p['e_files'])) {
|
||||
if (in_array($extl, $p['e_files'])) {
|
||||
$sql = "SELECT EXISTS(SELECT 1 FROM exiftool WHERE fid='".$fid."')";
|
||||
dfm($sql);
|
||||
$check = @$dbp->query($sql)->fetch();
|
||||
@@ -398,7 +431,7 @@ if ($p['meta'] && $btype == "file" && $ext != "DS_Store") {
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($ext, $p['m_files'])) {
|
||||
if (in_array($extl, $p['m_files'])) {
|
||||
$sql = "SELECT EXISTS(SELECT 1 FROM mediainfo WHERE fid='".$fid."')";
|
||||
dfm($sql);
|
||||
$check = @$dbp->query($sql)->fetch();
|
||||
@@ -406,7 +439,7 @@ if ($p['meta'] && $btype == "file" && $ext != "DS_Store") {
|
||||
dfm("creating mediainfo dump");
|
||||
$stmt = $dbp->prepare("INSERT INTO mediainfo VALUES (:fid, :info)");
|
||||
$stmt->BindValue(":fid",$fid);
|
||||
$stmt->BindValue(":info",shell_exec($bin_mediainfo." --Output=JSON ".$shellpath." ".$redirect));
|
||||
$stmt->BindValue(":info",shell_exec("( ".$bin_mediainfo." --Output=JSON ".$shellpath." ) ".$redirect));
|
||||
$sbatch[] = $stmt;
|
||||
$estring .= " ->minfo";
|
||||
} else {
|
||||
@@ -462,7 +495,7 @@ if ($p['contents'] && $btype == "file") {
|
||||
|
||||
$cpath = $bpath."/contents/".substr($fid, 0, 2);
|
||||
$cfile = $cpath."/".$fid.".zip";
|
||||
if (in_array($ext, $p['c_files'])) {
|
||||
if (in_array($extl, $p['c_files'])) {
|
||||
$max_size = $p['contents_limit'] * 1000;
|
||||
if ($ext == ".DS_Store") {
|
||||
// store all DS_Store files no matter how big
|
||||
@@ -496,7 +529,7 @@ if ($p['contents'] && $btype == "file") {
|
||||
|
||||
// Spotlight //////////////////////////////////////////
|
||||
|
||||
if ($p['spotlight']) {
|
||||
if (@$argv[8]) {
|
||||
|
||||
dfm("SPOTLIGHT",1);
|
||||
$estring .= " SPOTLIGHT";
|
||||
|
||||
@@ -1 +1 @@
|
||||
a:20:{s:5:"bdest";s:0:"";s:10:"rsync_dest";s:0:"";s:10:"postflight";i:1;s:11:"readability";i:0;s:9:"stat_mode";i:1;s:4:"meta";i:1;s:6:"thumbs";i:1;s:10:"thumb_size";i:512;s:10:"thumb_mode";i:0;s:5:"icons";i:1;s:9:"icon_size";i:256;s:9:"icon_mode";i:0;s:4:"hash";i:1;s:10:"hash_limit";i:1;s:8:"contents";i:1;s:14:"contents_limit";i:50;s:9:"spotlight";i:1;s:7:"profile";i:1;s:8:"parallel";i:1;s:5:"debug";i:0;}
|
||||
a:21:{s:5:"bdest";s:0:"";s:10:"rsync_dest";s:0:"";s:10:"postflight";i:1;s:11:"readability";i:0;s:9:"stat_mode";i:1;s:4:"meta";i:1;s:6:"thumbs";i:1;s:10:"thumb_size";i:512;s:10:"thumb_mode";i:0;s:5:"icons";i:1;s:9:"icon_size";i:256;s:9:"icon_mode";i:0;s:4:"hash";i:1;s:10:"hash_limit";i:1;s:8:"contents";i:1;s:14:"contents_limit";i:50;s:9:"spotlight";i:1;s:7:"profile";i:1;s:8:"parallel";i:1;s:5:"debug";i:0;s:5:"reuse";i:1;}
|
||||
@@ -852,7 +852,7 @@ if ($db_file) {
|
||||
|
||||
foreach ($sorted_bundles as $row) {
|
||||
foreach ($row as $bundle) {
|
||||
echo "<div id='bundle'>";
|
||||
echo "<div id='bundle'>";
|
||||
$dbs = array_reverse(glob($bundle."/????-??-??_??-??-??.sqlite3"));
|
||||
if ($dbs[0]) {
|
||||
$dbo = new PDO("sqlite:".$dbs[0]);
|
||||
@@ -866,6 +866,7 @@ if ($db_file) {
|
||||
foreach ($dbs as $db_file) {
|
||||
$dbo = new PDO("sqlite:".$db_file);
|
||||
$info = $dbo->query("SELECT * FROM _skim")->fetch();
|
||||
$status = "";
|
||||
if (strpos($info['status'],"completed") === 0) {
|
||||
$seconds = str_replace("completed_in_","",$info['status']);
|
||||
$s = (int)$seconds;
|
||||
@@ -873,6 +874,7 @@ if ($db_file) {
|
||||
echo "<div>";
|
||||
} else {
|
||||
echo "<div class='aborted'>";
|
||||
$status = $info['status'];
|
||||
}
|
||||
echo "<a href='?db=".$db_file."'>".pathinfo($db_file)['filename']."</a> ";
|
||||
echo $info['version'].", ";
|
||||
|
||||
Reference in New Issue
Block a user