From 84ab0a3b38c3bfcb2a718a78507078d63e945eab Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Wed, 6 Jan 2016 06:13:54 -0800 Subject: [PATCH] Improved the tag rebuild command's output. --- app/Console/Commands/RebuildTags.php | 10 ++++++---- app/Models/Track.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/RebuildTags.php b/app/Console/Commands/RebuildTags.php index 3898ed4a..366e12a5 100644 --- a/app/Console/Commands/RebuildTags.php +++ b/app/Console/Commands/RebuildTags.php @@ -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(); diff --git a/app/Models/Track.php b/app/Models/Track.php index 7ebf8751..c32c5aba 100644 --- a/app/Models/Track.php +++ b/app/Models/Track.php @@ -731,7 +731,7 @@ class Track extends Model } } - private function updateTagsForTrackFile($trackFile) { + private function updateTagsForTrackFile(TrackFile $trackFile) { $trackFile->touch(); if (\File::exists($trackFile->getFile())) {