Commit 7a603edc authored by Niklas de Vries's avatar Niklas de Vries

added mp3 support

parent 61ed31ae
......@@ -235,7 +235,7 @@ class MediaService
* @return string
* @throws MediaException
*/
protected function getFilePath(Media $media)
public function getFilePath(Media $media)
{
if (strpos($media->getFilename(), 'http') === 0) {
return $media->getFilename();
......@@ -301,6 +301,10 @@ class MediaService
return $this->storeImage($input);
break;
case 'application/pdf':
case 'audio/mp3':
case 'audio/mpeg':
case 'audio/mpeg3':
case 'audio/x-mpeg-3':
default:
return $this->storeFile($input, $mime);
}
......@@ -346,6 +350,10 @@ class MediaService
'image/tiff' => 'tif',
'image/webp' => 'webp',
'application/pdf' => 'pdf',
'audio/mp3' => 'mp3',
'audio/mpeg' => 'mp3',
'audio/mpeg3' => 'mp3',
'audio/x-mpeg-3' => 'mp3',
);
return (isset($map[$mime])) ? $map[$mime] : '.unknown';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment