Merge pull request #22 from shannah/master
Suppress check for valid audio on URLs to fix 'File not present' erro…
This commit is contained in:
commit
752935f83a
@ -213,8 +213,8 @@ class Mp3Info {
|
|||||||
self::$_sampleRateTable = require dirname(__FILE__).'/../data/sampleRateTable.php';
|
self::$_sampleRateTable = require dirname(__FILE__).'/../data/sampleRateTable.php';
|
||||||
|
|
||||||
$this->_fileName = $filename;
|
$this->_fileName = $filename;
|
||||||
|
$isLocal = (strpos($filename, '://') === false);
|
||||||
if (strpos($filename, '://') !== false) {
|
if (!$isLocal) {
|
||||||
$this->_fileSize = static::getUrlContentLength($filename);
|
$this->_fileSize = static::getUrlContentLength($filename);
|
||||||
} else {
|
} else {
|
||||||
if (!file_exists($filename)) {
|
if (!file_exists($filename)) {
|
||||||
@ -223,13 +223,14 @@ class Mp3Info {
|
|||||||
$this->_fileSize = filesize($filename);
|
$this->_fileSize = filesize($filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!static::isValidAudio($filename)) {
|
if ($isLocal and !static::isValidAudio($filename)) {
|
||||||
throw new \Exception('File ' . $filename . ' is not mpeg/audio!');
|
throw new \Exception('File ' . $filename . ' is not mpeg/audio!');
|
||||||
}
|
}
|
||||||
|
|
||||||
$mode = $parseTags ? self::META | self::TAGS : self::META;
|
$mode = $parseTags ? self::META | self::TAGS : self::META;
|
||||||
$this->audioSize = $this->parseAudio($this->_fileName, $this->_fileSize, $mode);
|
$this->audioSize = $this->parseAudio($this->_fileName, $this->_fileSize, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool|null
|
* @return bool|null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user