mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-16 18:14:23 +01:00
Added ALAC upload support and improved the upload page.
This commit is contained in:
parent
4b3a0808a0
commit
093f7ffb9d
4 changed files with 15 additions and 14 deletions
|
@ -51,6 +51,7 @@ class GenerateTrackFilesCommand extends CommandBase
|
||||||
'flac',
|
'flac',
|
||||||
'pcm',
|
'pcm',
|
||||||
'adpcm',
|
'adpcm',
|
||||||
|
'alac'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(Track $track, SplFileInfo $sourceFile, bool $autoPublish = false)
|
public function __construct(Track $track, SplFileInfo $sourceFile, bool $autoPublish = false)
|
||||||
|
|
|
@ -112,8 +112,8 @@ class UploadTrackCommand extends CommandBase
|
||||||
'track' =>
|
'track' =>
|
||||||
'required|'
|
'required|'
|
||||||
. ($this->_allowLossy
|
. ($this->_allowLossy
|
||||||
? 'audio_format:flac,pcm,adpcm,aac,mp3,vorbis|'
|
? 'audio_format:flac,alac,pcm,adpcm,aac,mp3,vorbis|'
|
||||||
: 'audio_format:flac,pcm,adpcm|')
|
: 'audio_format:flac,alac,pcm,adpcm|')
|
||||||
. ($this->_allowShortTrack ? '' : 'min_duration:30|')
|
. ($this->_allowShortTrack ? '' : 'min_duration:30|')
|
||||||
. 'audio_channels:1,2',
|
. 'audio_channels:1,2',
|
||||||
|
|
||||||
|
@ -250,22 +250,16 @@ class UploadTrackCommand extends CommandBase
|
||||||
// all tags read by getID3, including the cover art
|
// all tags read by getID3, including the cover art
|
||||||
$allTags = $getId3->analyze($file->getPathname());
|
$allTags = $getId3->analyze($file->getPathname());
|
||||||
|
|
||||||
// tags specific to a file format (ID3 or Atom), pre-normalization but with cover art removed
|
// $rawTags => tags specific to a file format (ID3 or Atom), pre-normalization but with cover art removed
|
||||||
$rawTags = [];
|
// $parsedTags => normalized tags used by Pony.fm
|
||||||
|
|
||||||
// normalized tags used by Pony.fm
|
|
||||||
$parsedTags = [];
|
|
||||||
|
|
||||||
if ($audioCodec === 'mp3') {
|
if ($audioCodec === 'mp3') {
|
||||||
list($parsedTags, $rawTags) = $this->getId3Tags($allTags);
|
list($parsedTags, $rawTags) = $this->getId3Tags($allTags);
|
||||||
|
|
||||||
} elseif (Str::startsWith($audioCodec, 'aac')) {
|
} elseif (Str::startsWith($audioCodec, ['aac', 'alac'])) {
|
||||||
list($parsedTags, $rawTags) = $this->getAtomTags($allTags);
|
list($parsedTags, $rawTags) = $this->getAtomTags($allTags);
|
||||||
|
|
||||||
} elseif ($audioCodec === 'vorbis') {
|
} elseif (in_array($audioCodec, ['vorbis', 'flac'])) {
|
||||||
list($parsedTags, $rawTags) = $this->getVorbisTags($allTags);
|
|
||||||
|
|
||||||
} elseif ($audioCodec === 'flac') {
|
|
||||||
list($parsedTags, $rawTags) = $this->getVorbisTags($allTags);
|
list($parsedTags, $rawTags) = $this->getVorbisTags($allTags);
|
||||||
|
|
||||||
} elseif (Str::startsWith($audioCodec, ['pcm', 'adpcm'])) {
|
} elseif (Str::startsWith($audioCodec, ['pcm', 'adpcm'])) {
|
||||||
|
|
|
@ -64,6 +64,10 @@ class PfmValidator extends Illuminate\Validation\Validator
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array('alac', $parameters) && Str::startsWith($codecString, 'alac')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return in_array($file->getAudioCodec(), $parameters);
|
return in_array($file->getAudioCodec(), $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,13 @@
|
||||||
<p>Drop files here to begin your upload!</p>
|
<p>Drop files here to begin your upload!</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>FLAC, WAV, and AIFF files will be accepted. Each file can be up to 200 MB in size.</p>
|
<p>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.</p>
|
||||||
|
|
||||||
<p>Tracks must be a <strong>minimum</strong> of 30 seconds long.</p>
|
<p>Tracks must be a <strong>minimum</strong> of 30 seconds long.</p>
|
||||||
|
|
||||||
<p>Please note that you need to publish your tracks after uploading them before they will become available to the public.</p>
|
<p>Note that you'll need to publish your tracks after uploading them before they'll become available to the public.</p>
|
||||||
|
|
||||||
|
<p>Contact <a href="mailto:feld0@pony.fm">feld0@pony.fm</a> if you run into any issues!</p>
|
||||||
|
|
||||||
<ul class="uploads">
|
<ul class="uploads">
|
||||||
<li ng-repeat="upload in data.queue track by $index" ng-class="{'uploading': upload.isUploading, 'has-error': upload.error != null, 'is-processing': upload.isProcessing || upload.progress >= 100}" ng-animate="'upload-queue'">
|
<li ng-repeat="upload in data.queue track by $index" ng-class="{'uploading': upload.isUploading, 'has-error': upload.error != null, 'is-processing': upload.isProcessing || upload.progress >= 100}" ng-animate="'upload-queue'">
|
||||||
|
|
Loading…
Reference in a new issue