T357: Gracefully handle missing tags in M4A and OGG files.

This commit is contained in:
Peter Deltchev 2015-09-12 02:11:52 -07:00
parent 5f69cdda5b
commit 9b9f25dc51

View file

@ -451,7 +451,13 @@ class ImportMLPMA extends Command {
* @return array * @return array
*/ */
protected function getAtomTags($rawTags) { protected function getAtomTags($rawTags) {
if (array_key_exists('tags', $rawTags) &&
array_key_exists('quicktime', $rawTags['tags'])) {
$tags = $rawTags['tags']['quicktime']; $tags = $rawTags['tags']['quicktime'];
} else {
$tags = [];
}
$trackNumber = null; $trackNumber = null;
if (isset($tags['track_number'])) { if (isset($tags['track_number'])) {
@ -480,7 +486,13 @@ class ImportMLPMA extends Command {
* @return array * @return array
*/ */
protected function getVorbisTags($rawTags) { protected function getVorbisTags($rawTags) {
if (array_key_exists('tags', $rawTags) &&
array_key_exists('vorbiscomment', $rawTags['tags'])
) {
$tags = $rawTags['tags']['vorbiscomment']; $tags = $rawTags['tags']['vorbiscomment'];
} else {
$tags = [];
}
$trackNumber = null; $trackNumber = null;
if (isset($tags['track_number'])) { if (isset($tags['track_number'])) {