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

This commit is contained in:
Kelvin Zhang 2015-09-12 16:01:53 +01:00
parent 5e4875b9ad
commit 7c2863b942

View file

@ -431,7 +431,11 @@ class ImportMLPMA extends Command
*/ */
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'])) {
@ -462,7 +466,11 @@ class ImportMLPMA extends Command
*/ */
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'])) {