mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Include the original-size cover art when tagging tracks.
Also, use Symfony to run external commands.
This commit is contained in:
parent
0a078adab3
commit
95090fb334
2 changed files with 7 additions and 7 deletions
|
@ -18,17 +18,17 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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() . '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue