fix id3 tag resolve. should use utf8 from getID3 directly but not

to convert them from ISO8859-1 to utf8 after analyze.
This commit is contained in:
Weng Xuetian 2011-10-24 12:55:05 +00:00 committed by Robin Appelman
parent ef124c3e21
commit 0d274b0268
1 changed files with 2 additions and 4 deletions

View File

@ -93,6 +93,7 @@ class OC_MEDIA_SCANNER{
}
if(!self::$getID3){
self::$getID3=@new getID3();
self::$getID3->encoding='UTF-8';
}
$data=@self::$getID3->analyze($file);
getid3_lib::CopyTagsToComments($data);
@ -105,21 +106,18 @@ class OC_MEDIA_SCANNER{
$artist='unknown';
}else{
$artist=stripslashes($data['comments']['artist'][0]);
$artist=utf8_encode($artist);
}
if(!isset($data['comments']['album'])){
OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN);
$album='unknown';
}else{
$album=stripslashes($data['comments']['album'][0]);
$album=utf8_encode($album);
}
if(!isset($data['comments']['title'])){
OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN);
$title='unknown';
}else{
$title=stripslashes($data['comments']['title'][0]);
$title=utf8_encode($title);
}
$size=$data['filesize'];
$track=(isset($data['comments']['track']))?$data['comments']['track'][0]:0;
@ -150,4 +148,4 @@ class OC_MEDIA_SCANNER{
$ext=substr($filename,strrpos($filename,'.')+1);
return $ext=='mp3' || $ext=='flac' || $ext=='m4a' || $ext=='ogg' || $ext=='oga';
}
}
}