diff --git a/src/Hathor/Command/ScannerCommand.php b/src/Hathor/Command/ScannerCommand.php index e98e583..0054063 100644 --- a/src/Hathor/Command/ScannerCommand.php +++ b/src/Hathor/Command/ScannerCommand.php @@ -39,6 +39,7 @@ class ScannerCommand extends BaseCommand $extensionRegex .= sprintf('\.%s|',$extension); } + $extensionRegex[strlen($extensionRegex)-1] = ')'; $extensionRegex .= '\b$/i'; @@ -61,19 +62,21 @@ class ScannerCommand extends BaseCommand $progress->setEmptyBarCharacter('#'); //$progress->setRedrawFrequency(100); - $cols = shell_exec('tput cols'); + $cols = shell_exec('tput cols') - 20; foreach ($finder as $file) { $progress->setMessage(str_repeat('-', $cols - 5)); //$currentDir = explode(DIRECTORY_SEPARATOR, $file->getRelativePath()); //$currentDir = $currentDir[count($currentDir)-1]; //$currentDir = substr($currentDir[count($currentDir)-1],0,60); - $currentFile = substr($file->getFilename(), 0,$cols - 30); - $progress->setMessage("Current File - $currentFile ..."); + $currentFile = str_pad(substr($file->getFilename(), 0, $cols) . ' ...', $cols, ' '); - //$getID3->setFile($file->getRealPath()); + $progress->setMessage("Current File - $currentFile "); + + $getID3->setFile($file->getRealPath()); try { - // $allMusicData[] = $getID3->getFileData (); + + $allMusicData[] = $getID3->getFileData (); } catch(\Exception $e) { $progress->setMessage('Caught RuntimeException'); continue;