diff --git a/getid3/getid3.php b/getid3/getid3.php index 6981b8c9..6a17cb04 100644 --- a/getid3/getid3.php +++ b/getid3/getid3.php @@ -387,7 +387,7 @@ class getID3 */ protected $startup_warning = ''; - const VERSION = '1.9.23-202407291427'; + const VERSION = '1.9.23-202408061058'; const FREAD_BUFFER_SIZE = 32768; const ATTACHMENTS_NONE = false; @@ -680,6 +680,8 @@ public function analyze($filename, $filesize=null, $original_filename='', $fp=nu catch (getid3_exception $e) { throw $e; } + } else { + $this->warning('skipping check for '.$tag_name.' tags since option_tag_'.$tag_name.'=FALSE'); } } if (isset($this->info['id3v2']['tag_offset_start'])) { diff --git a/getid3/module.tag.lyrics3.php b/getid3/module.tag.lyrics3.php index d37bb7a8..687f23c9 100644 --- a/getid3/module.tag.lyrics3.php +++ b/getid3/module.tag.lyrics3.php @@ -110,19 +110,23 @@ public function Analyze() { if (!isset($info['ape'])) { if (isset($info['lyrics3']['tag_offset_start'])) { $GETID3_ERRORARRAY = &$info['warning']; - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true); - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_apetag = new getid3_apetag($getid3_temp); - $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start']; - $getid3_apetag->Analyze(); - if (!empty($getid3_temp->info['ape'])) { - $info['ape'] = $getid3_temp->info['ape']; - } - if (!empty($getid3_temp->info['replay_gain'])) { - $info['replay_gain'] = $getid3_temp->info['replay_gain']; + if ($this->getid3->option_tag_apetag) { + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true); + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_apetag = new getid3_apetag($getid3_temp); + $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start']; + $getid3_apetag->Analyze(); + if (!empty($getid3_temp->info['ape'])) { + $info['ape'] = $getid3_temp->info['ape']; + } + if (!empty($getid3_temp->info['replay_gain'])) { + $info['replay_gain'] = $getid3_temp->info['replay_gain']; + } + unset($getid3_temp, $getid3_apetag); + } else { + $this->warning('Unable to check for Lyrics3 and APE tags interaction since option_tag_apetag=FALSE'); } - unset($getid3_temp, $getid3_apetag); } else { $this->warning('Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)'); } @@ -296,19 +300,19 @@ public function Lyrics3LyricsTimestampParse(&$Lyrics3data) { if (isset($thislinetimestamps) && is_array($thislinetimestamps)) { sort($thislinetimestamps); foreach ($thislinetimestamps as $timestampkey => $timestamp) { - if (isset($Lyrics3data['synchedlyrics'][$timestamp])) { + if (isset($Lyrics3data['comments']['synchedlyrics'][$timestamp])) { // timestamps only have a 1-second resolution, it's possible that multiple lines // could have the same timestamp, if so, append - $Lyrics3data['synchedlyrics'][$timestamp] .= "\r\n".$lyricline; + $Lyrics3data['comments']['synchedlyrics'][$timestamp] .= "\r\n".$lyricline; } else { - $Lyrics3data['synchedlyrics'][$timestamp] = $lyricline; + $Lyrics3data['comments']['synchedlyrics'][$timestamp] = $lyricline; } } } } - $Lyrics3data['unsynchedlyrics'] = implode("\r\n", $notimestamplyricsarray); - if (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) { - ksort($Lyrics3data['synchedlyrics']); + $Lyrics3data['comments']['unsynchedlyrics'][0] = implode("\r\n", $notimestamplyricsarray); + if (isset($Lyrics3data['comments']['synchedlyrics']) && is_array($Lyrics3data['comments']['synchedlyrics'])) { + ksort($Lyrics3data['comments']['synchedlyrics']); } return true; }