summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2012-04-12 21:56:27 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2012-04-12 21:56:27 -0400
commit8af2544b279b62cac287784840d26ff72568e9c5 (patch)
tree8b081df9a62d1939decabfdadc002dbf34752b8c
parentecdb8bc02df492995431eed115750ae427b67543 (diff)
downloadampache-8af2544b279b62cac287784840d26ff72568e9c5.tar.gz
ampache-8af2544b279b62cac287784840d26ff72568e9c5.tar.bz2
ampache-8af2544b279b62cac287784840d26ff72568e9c5.zip
Refactor getting MBIDs from ID3 tags
Just grab the info from the TXXX bit, instead of relying on a correlation between the raw tags and the cooked ones.
-rw-r--r--lib/class/vainfo.class.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php
index 1aeaddcb..53ad2578 100644
--- a/lib/class/vainfo.class.php
+++ b/lib/class/vainfo.class.php
@@ -701,12 +701,14 @@ class vainfo {
}
// Find the MBIDs for the album and artist
- for ($i = 0, $size = sizeof($id3v2['comments']['text']) ; $i < $size ; $i++) {
- if ($id3v2['TXXX'][$i]['description'] == 'MusicBrainz Album Id') {
- $array['mb_albumid'] = $this->_clean_tag($id3v2['comments']['text'][$i]);
- }
- elseif ($id3v2['TXXX'][$i]['description'] == 'MusicBrainz Artist Id') {
- $array['mb_artistid'] = $this->_clean_tag($id3v2['comments']['text'][$i]);
+ foreach ($id3v2['TXXX'] as $txxx) {
+ switch ($txxx['description']) {
+ case 'MusicBrainz Album Id':
+ $array['mb_albumid'] = $this->_clean_tag($txxx['data']);
+ break;
+ case 'MusicBrainz Artist Id':
+ $array['mb_artistid'] = $this->_clean_tag($txxx['data']);
+ break;
}
}
}