diff --git a/app/Console/Commands/ImportMLPMA.php b/app/Console/Commands/ImportMLPMA.php
index 1bf660ae..b060f694 100644
--- a/app/Console/Commands/ImportMLPMA.php
+++ b/app/Console/Commands/ImportMLPMA.php
@@ -15,7 +15,7 @@ use Illuminate\Support\Str;
use Input;
use Symfony\Component\HttpFoundation\File\UploadedFile;
-require_once(app_path() . '/Library/getid3/getid3/getid3.php');
+//require_once(app_path() . '/Library/getid3/getid3/getid3.php');
class ImportMLPMA extends Command
{
diff --git a/app/Console/Commands/RebuildTags.php b/app/Console/Commands/RebuildTags.php
new file mode 100644
index 00000000..e379ca6b
--- /dev/null
+++ b/app/Console/Commands/RebuildTags.php
@@ -0,0 +1,53 @@
+argument('trackId')) {
+ $track = Track::findOrFail($this->argument('trackId'));
+ $tracks = [$track];
+ } else {
+ $tracks = Track::whereNotNull('published_at')->get();
+ }
+
+ foreach($tracks as $track) {
+ $this->comment('Rewriting tags for track #'.$track->id.'...');
+ $track->updateTags();
+ }
+ }
+}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index d29e84c1..6e569828 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -17,6 +17,7 @@ class Kernel extends ConsoleKernel
\App\Console\Commands\RefreshCache::class,
\App\Console\Commands\ImportMLPMA::class,
\App\Console\Commands\ClassifyMLPMA::class,
+ \App\Console\Commands\RebuildTags::class,
];
/**
diff --git a/app/Track.php b/app/Track.php
index 7358dc1f..99eb3820 100644
--- a/app/Track.php
+++ b/app/Track.php
@@ -570,7 +570,7 @@ class Track extends Model
}
if ($this->cover !== null) {
- $command .= '--artwork ' . $this->getCoverUrl() . ' ';
+ $command .= '--artwork ' . $this->cover->getFile() . ' ';
}
$command .= '--overWrite';
@@ -609,9 +609,9 @@ class Track extends Model
$tagWriter->tag_data['track'] = [$this->track_number];
}
- if ($format == 'MP3' && $this->cover_id != null && is_file($this->cover->file)) {
+ if ($format == 'MP3' && $this->cover_id != null && is_file($this->cover->getFile())) {
$tagWriter->tag_data['attached_picture'][0] = [
- 'data' => file_get_contents($this->cover->file),
+ 'data' => file_get_contents($this->cover->getFile()),
'picturetypeid' => 2,
'description' => 'cover',
'mime' => 'image/png'
@@ -623,10 +623,10 @@ class Track extends Model
if ($tagWriter->WriteTags()) {
if (!empty($tagWriter->warnings)) {
- Log::warning('There were some warnings:
' . implode('
', $tagWriter->warnings));
+ Log::warning('Track #'.$this->id.': There were some warnings:
' . implode('
', $tagWriter->warnings));
}
} else {
- Log::error('Failed to write tags!
' . implode('
', $tagWriter->errors));
+ Log::error('Track #' . $this->id . ': Failed to write tags!
' . implode('
', $tagWriter->errors));
}
}
diff --git a/vagrant/install.sh b/vagrant/install.sh
index 8832e0b2..d5f8d518 100755
--- a/vagrant/install.sh
+++ b/vagrant/install.sh
@@ -7,7 +7,7 @@ echo "Installing tagging tools..."
sudo apt-get -qq install -y AtomicParsley flac vorbis-tools imagemagick
echo "Installing ffmpeg dependencies.."
-sudo apt-get -qq install -y pkg-config yasm libfaac-dev libmp3lame-dev libvorbis-dev
+sudo apt-get -qq install -y pkg-config yasm libfaac-dev libmp3lame-dev libvorbis-dev libtheora-dev
if type ffmpeg &>/dev/null; then
@@ -18,7 +18,7 @@ else
wget "https://ffmpeg.org/releases/ffmpeg-2.6.3.tar.bz2"
tar -xjf "ffmpeg-2.6.3.tar.bz2"
cd "ffmpeg-2.6.3"
- ./configure --enable-gpl --enable-encoder=flac --enable-encoder=alac --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-nonfree
+ ./configure --enable-gpl --enable-encoder=flac --enable-encoder=alac --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-nonfree
make -j4
sudo make install
fi