mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 21:18:00 +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')) {
|
if ($this->argument('trackId')) {
|
||||||
$track = Track::findOrFail($this->argument('trackId'));
|
$track = Track::findOrFail($this->argument('trackId'));
|
||||||
$tracks = [$track];
|
$tracks = [$track];
|
||||||
|
|
||||||
} else {
|
} 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) {
|
foreach($tracks as $track) {
|
||||||
$this->comment('Rewriting tags for track #'.$track->id.'...');
|
$this->comment('Rewriting tags for track #'.$track->id.'...');
|
||||||
$track->updateTags();
|
$track->updateTags();
|
||||||
}
|
$bar->advance();
|
||||||
|
$this->line('');
|
||||||
|
}
|
||||||
|
|
||||||
|
$bar->finish();
|
||||||
|
$this->line('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue