summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authormomo-i <momo-i@ampache>2008-09-04 22:20:49 +0000
committermomo-i <momo-i@ampache>2008-09-04 22:20:49 +0000
commitb000e8a448ca150abe2f1593c62fe6326cb0a819 (patch)
tree3100aaf8f3f92613b0ff287b57bea232bf567305 /lib/class
parent01670c6abda538b5b40893f5015bfc4913382841 (diff)
downloadampache-b000e8a448ca150abe2f1593c62fe6326cb0a819.tar.gz
ampache-b000e8a448ca150abe2f1593c62fe6326cb0a819.tar.bz2
ampache-b000e8a448ca150abe2f1593c62fe6326cb0a819.zip
Fixed #300 (Thx abs0) and Fixed didn't catch exception first analyze.
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/vainfo.class.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php
index 206a146c..fb668078 100644
--- a/lib/class/vainfo.class.php
+++ b/lib/class/vainfo.class.php
@@ -68,7 +68,13 @@ class vainfo {
$this->_getID3 = new getID3();
// get id3tag encodings
- $this->_raw2 = $this->_getID3->analyze($file);
+ try {
+ $this->_raw2 = $this->_getID3->analyze($file);
+ }
+ catch (Exception $error) {
+ debug_event('getid3',$error->message,'1');
+ }
+
if(function_exists('mb_detect_encoding')) {
$this->encoding_id3v1 = array();
$this->encoding_id3v1[] = mb_detect_encoding($this->_raw2['tags']['id3v1']['artist']['0']);
@@ -566,12 +572,16 @@ class vainfo {
// If we've got iconv then go ahead and clear her up
if ($this->_iconv) {
/* Guess that it's UTF-8 */
+ /* Try GNU iconv //TRANSLIT extension first */
if (!$encoding) { $encoding = $this->_getID3->encoding; }
$charset = $this->encoding . '//TRANSLIT';
- $tag = iconv($encoding,$charset,$tag);
+ $enc_tag = iconv($encoding,$charset,$tag);
+ if(strcmp($enc_tag, "") == 0) {
+ $enc_tag = iconv($encoding,$this->encoding,$tag);
+ }
}
- return $tag;
+ return $enc_tag;
} // _clean_tag