diff --git a/app/Library/External.php b/app/Library/External.php index a866f31c..25aaeea6 100644 --- a/app/Library/External.php +++ b/app/Library/External.php @@ -18,17 +18,17 @@ * along with this program. If not, see . */ -use Illuminate\Support\Facades\Log; +use Symfony\Component\Process\Process; class External { public static function execute($command) { - $output = []; - $error = exec($command, $output); + $process = new Process($command); + $process->run(); - if ($error != null) { - Log::error('"' . $command . '" failed with "' . $error . '"'); + if (!$process->isSuccessful()) { + Log::error('"' . $command . '" failed with "' . $process->getErrorOutput() . '"'); } } } diff --git a/app/Models/Track.php b/app/Models/Track.php index 5c7bd285..7ebf8751 100644 --- a/app/Models/Track.php +++ b/app/Models/Track.php @@ -760,7 +760,7 @@ class Track extends Model } if ($this->cover !== null) { - $command .= '--artwork ' . $this->cover->getFile() . ' '; + $command .= '--artwork ' . $this->cover->getFile(Image::ORIGINAL) . ' '; } $command .= '--overWrite'; @@ -801,7 +801,7 @@ class Track extends Model if ($format == 'MP3' && $this->cover_id != null && is_file($this->cover->getFile())) { $tagWriter->tag_data['attached_picture'][0] = [ - 'data' => file_get_contents($this->cover->getFile()), + 'data' => file_get_contents($this->cover->getFile(Image::ORIGINAL)), 'picturetypeid' => 2, 'description' => 'cover', 'mime' => $this->cover->mime