Improved the tag rebuild command's output.

This commit is contained in:
Peter Deltchev 2016-01-06 06:13:54 -08:00
parent 95090fb334
commit 84ab0a3b38
2 changed files with 7 additions and 5 deletions

View file

@ -61,16 +61,18 @@ class RebuildTags extends Command
$tracks = [$track];
} else {
$tracks = Track::whereNotNull('published_at')->orderBy('id', 'asc')->get();
$tracks = Track::whereNotNull('published_at')->withTrashed()->orderBy('id', 'asc')->get();
}
$bar = $this->output->createProgressBar(sizeof($tracks));
$numberOfTracks = sizeof($tracks);
$this->info("Updating tags for ${numberOfTracks} tracks...");
$bar = $this->output->createProgressBar($numberOfTracks);
foreach($tracks as $track) {
$this->comment('Rewriting tags for track #'.$track->id.'...');
/** @var $track Track */
$track->updateTags();
$bar->advance();
$this->line('');
}
$bar->finish();

View file

@ -731,7 +731,7 @@ class Track extends Model
}
}
private function updateTagsForTrackFile($trackFile) {
private function updateTagsForTrackFile(TrackFile $trackFile) {
$trackFile->touch();
if (\File::exists($trackFile->getFile())) {