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:
parent
ef124c3e21
commit
0d274b0268
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue