error("Media path hasn't been configured. Exiting.");
return;
}
$this->info('Koel syncing started. All we need now is just a little patience…');
Media::sync(null, $this);
$this->output->writeln("Completed! {$this->synced} new or updated songs(s), "
."{$this->ignored} unchanged song(s), "
."and {$this->invalid} invalid file(s).");
}
/**
* Log a song's sync status to console.
*/
public function logToConsole($path, $result)
{
$name = basename($path);
if ($result === true) {
if ($this->option('verbose')) {
$this->line("$name has no changes – ignoring");
}
++$this->ignored;
} elseif ($result === false) {
if ($this->option('verbose')) {
$this->error("$name is not a valid media file");
}
++$this->invalid;
} else {
if ($this->option('verbose')) {
$this->info("$name synced");
}
++$this->synced;
}
}
}