mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 13:07:59 +01:00
Updated the rebuild:tags command with a progress bar.
This commit is contained in:
parent
7d76e2d74d
commit
ae39784708
1 changed files with 9 additions and 1 deletions
|
@ -41,13 +41,21 @@ class RebuildTags extends Command
|
|||
if ($this->argument('trackId')) {
|
||||
$track = Track::findOrFail($this->argument('trackId'));
|
||||
$tracks = [$track];
|
||||
|
||||
} else {
|
||||
$tracks = Track::whereNotNull('published_at')->get();
|
||||
$tracks = Track::whereNotNull('published_at')->orderBy('id', 'asc')->get();
|
||||
}
|
||||
|
||||
$bar = $this->output->createProgressBar(sizeof($tracks));
|
||||
|
||||
foreach($tracks as $track) {
|
||||
$this->comment('Rewriting tags for track #'.$track->id.'...');
|
||||
$track->updateTags();
|
||||
$bar->advance();
|
||||
$this->line('');
|
||||
}
|
||||
|
||||
$bar->finish();
|
||||
$this->line('');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue