Print info on file type support

old-stable24
Varun Patil 2022-10-25 10:20:50 -07:00
parent 4e796912be
commit 02becf6766
1 changed files with 10 additions and 2 deletions

View File

@ -115,14 +115,22 @@ class Index extends Command
{
// Print mime type support information
$output->writeln('MIME Type support:');
foreach (Application::IMAGE_MIMES as $mimeType) {
$mimes = array_merge(Application::IMAGE_MIMES, Application::VIDEO_MIMES);
$someUnsupported = false;
foreach ($mimes as &$mimeType) {
if ($this->preview->isMimeSupported($mimeType)) {
$output->writeln(" {$mimeType}: supported");
} else {
$output->writeln(" {$mimeType}: <error>not supported by preview generator</error>");
$output->writeln(" {$mimeType}: <error>not supported</error>");
$someUnsupported = true;
}
}
// Print file type support info
if ($someUnsupported) {
$output->writeln("\nSome file types are not supported by your preview provider.\nPlease see https://github.com/pulsejet/memories/wiki/File-Type-Support\n");
}
// Get options and arguments
$refresh = $input->getOption('refresh') ? true : false;
$clear = $input->getOption('clear') ? true : false;