Sonerezh / sonerezh

A self-hosted, web-based application to stream your music, everywhere.
https://www.sonerezh.bzh
GNU Affero General Public License v3.0
766 stars 122 forks source link

Import flac file fail for metadata with special characters (?, ê, ...) #296

Closed yabb85 closed 7 years ago

yabb85 commented 7 years ago

hi,

I cannot import a part of my flac library because several files contains special characters. I t is possible to send a file with problem to help the resolution.

Best regards

yabb85 commented 7 years ago

I obtains error "Metadata are unreadable or empty. Trying to import anyway...". I think the error is geenrated by Getid3 library

yabb85 commented 7 years ago

after a first investigation the problem is the filename with special characters

the code impacted is: $filename = str_replace('/', DIRECTORY_SEPARATOR, $filename); $filename = preg_replace('#(.+)'.preg_quote(DIRECTORY_SEPARATOR).'{2,}#U', '\1'.DIRECTORY_SEPARATOR, $filename);

// open local file if (is_readable($filename) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) { // great } else { throw new getid3_exception('Could not open "'.$filename.'" (does not exist, or is not a file)'); }

the name of file is: /path/Saez/Jours étranges/Saez - Jours étranges - 11 - Montée là-haut.flac

MightyCreak commented 7 years ago

Just for the sake of testing, if you try to import an mp3 version of your flac, does it work?

yabb85 commented 7 years ago

Hi,

I check the same file converted in mp3 and it works. This bug is only on flac files.

yabb85 commented 7 years ago

The problem is another script, it change permission on files. After fix of permission on files, all work correctly. Sorry for the convenience