diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 414c5f3f0..4673ce9c6 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -1716,25 +1716,20 @@ class ProcessAdditional if ($retVal === false) { // Get the media info for the file. - $xmlArray = runCmd( - $this->_killString.Settings::settingValue('apps..mediainfopath').'" --Output=XML "'.$fileLocation.'"' - ); + $xmlArray = $this->mediaInfo->getInfo($fileLocation, false); - // Convert to array. - $arrXml = Utility::objectsIntoArray(@simplexml_load_string($xmlArray)); - - if (isset($arrXml['File']['track'])) { - foreach ($arrXml['File']['track'] as $track) { - if (isset($track['Album'], $track['Performer'])) { + if ($xmlArray !== null) { + foreach ($xmlArray->getAudios() as $track) { + if (isset($track['album'], $track['performer'])) { if ((int) $this->_release->predb_id === 0 && config('nntmux.rename_music_mediainfo')) { // Make the extension upper case. $ext = strtoupper($fileExtension); // Form a new search name. - if (! empty($track['Recorded_date']) && preg_match('/(?:19|20)\d\d/', $track['Recorded_date'], $Year)) { - $newName = $track['Performer'].' - '.$track['Album'].' ('.$Year[0].') '.$ext; + if (! empty($track['recorded_date']) && preg_match('/(?:19|20)\d\d/', $track['recorded_date'], $Year)) { + $newName = $track['performer'].' - '.$track['album'].' ('.$Year[0].') '.$ext; } else { - $newName = $track['Performer'].' - '.$track['Album'].' '.$ext; + $newName = $track['performer'].' - '.$track['album'].' '.$ext; } // Get the category or try to determine it. diff --git a/Changelog b/Changelog index 2e6715da1..f09d79f53 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-10-28 DariusIII + * Chg: Update _getAudioInfo function to use mhor/php-mediainfo * Chg: Update PPA class 2018-10-27 DariusIII * Chg: Remove unused showFloodWarning function