diff --git a/app/Commands/GenerateTrackFilesCommand.php b/app/Commands/GenerateTrackFilesCommand.php index d345f002..8663cfe2 100644 --- a/app/Commands/GenerateTrackFilesCommand.php +++ b/app/Commands/GenerateTrackFilesCommand.php @@ -51,6 +51,7 @@ class GenerateTrackFilesCommand extends CommandBase 'flac', 'pcm', 'adpcm', + 'alac' ]; public function __construct(Track $track, SplFileInfo $sourceFile, bool $autoPublish = false) diff --git a/app/Commands/UploadTrackCommand.php b/app/Commands/UploadTrackCommand.php index b50f0302..4e42c86a 100644 --- a/app/Commands/UploadTrackCommand.php +++ b/app/Commands/UploadTrackCommand.php @@ -112,8 +112,8 @@ class UploadTrackCommand extends CommandBase 'track' => 'required|' . ($this->_allowLossy - ? 'audio_format:flac,pcm,adpcm,aac,mp3,vorbis|' - : 'audio_format:flac,pcm,adpcm|') + ? 'audio_format:flac,alac,pcm,adpcm,aac,mp3,vorbis|' + : 'audio_format:flac,alac,pcm,adpcm|') . ($this->_allowShortTrack ? '' : 'min_duration:30|') . 'audio_channels:1,2', @@ -250,22 +250,16 @@ class UploadTrackCommand extends CommandBase // all tags read by getID3, including the cover art $allTags = $getId3->analyze($file->getPathname()); - // tags specific to a file format (ID3 or Atom), pre-normalization but with cover art removed - $rawTags = []; - - // normalized tags used by Pony.fm - $parsedTags = []; + // $rawTags => tags specific to a file format (ID3 or Atom), pre-normalization but with cover art removed + // $parsedTags => normalized tags used by Pony.fm if ($audioCodec === 'mp3') { list($parsedTags, $rawTags) = $this->getId3Tags($allTags); - } elseif (Str::startsWith($audioCodec, 'aac')) { + } elseif (Str::startsWith($audioCodec, ['aac', 'alac'])) { list($parsedTags, $rawTags) = $this->getAtomTags($allTags); - } elseif ($audioCodec === 'vorbis') { - list($parsedTags, $rawTags) = $this->getVorbisTags($allTags); - - } elseif ($audioCodec === 'flac') { + } elseif (in_array($audioCodec, ['vorbis', 'flac'])) { list($parsedTags, $rawTags) = $this->getVorbisTags($allTags); } elseif (Str::startsWith($audioCodec, ['pcm', 'adpcm'])) { diff --git a/app/Library/PfmValidator.php b/app/Library/PfmValidator.php index ecbc5fdc..9b4ce6db 100644 --- a/app/Library/PfmValidator.php +++ b/app/Library/PfmValidator.php @@ -64,6 +64,10 @@ class PfmValidator extends Illuminate\Validation\Validator return true; } + if (in_array('alac', $parameters) && Str::startsWith($codecString, 'alac')) { + return true; + } + return in_array($file->getAudioCodec(), $parameters); } diff --git a/public/templates/uploader/index.html b/public/templates/uploader/index.html index b965c87b..65fc7159 100644 --- a/public/templates/uploader/index.html +++ b/public/templates/uploader/index.html @@ -3,11 +3,13 @@
Drop files here to begin your upload!
-FLAC, WAV, and AIFF files will be accepted. Each file can be up to 200 MB in size.
+Our preferred formats are FLAC, WAV, AIFF, and ALAC (because lossless audio is awesome) but we accept a few others, too. Each file can be up to 200 MB in size.
Tracks must be a minimum of 30 seconds long.
-Please note that you need to publish your tracks after uploading them before they will become available to the public.
+Note that you'll need to publish your tracks after uploading them before they'll become available to the public.
+ +Contact feld0@pony.fm if you run into any issues!