-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full library updates #98
Comments
Mpd has it's own indexing engine, while O!MPD uses getID3 to read metadata from files. When you update DB in O!MPD, it sends |
Okay, so I'm having this same problem with the album "We are not your kind" - other albums before and since that I've added show up in O!MPD just fine (because it's a great bit of software!) - but this particular album just keeps not having it's data show up. It gets the album art just fine, but it seems as if it can't see the music. (See screenshot). I've also attached the update log, because to me it looks as if it's actually adding the tracks. As far as I can tell, the tracks are properly picked up by MPD (and will play just fine if I start it from MPD itself - you can see where I was doing that in the screenshot as well). Any guidance on where to poke next to try to debug this? |
Thanks for reporting this. Do you use |
I'm using Apache, sorry. I've seen some other people in a cursory search showing some problems with server.stream-response-body, but the answers seem to be fixing the code of the program? Again, though, it plays just fine, and it seems to be just that one album. :/ |
Strange, when I switch to Apache (normally I use nginx, but for a long time I had been using Apache) everything works OK. |
And please attach |
First of all, thanks for OMPD! I've been using it for many years now. I also have the exact same problem. These problems started appearing several months ago, probably around the same time the PHP package was upgraded. Now I can't add a single album without this issue. Let me know if there is anything else I can help with to debug this problem. |
Thanks for that. In 2f80962 I changed update procedure a bit to prevent such situations. Hope it'll help - please try it and let me know. |
Thanks for the quick response! |
Thanks for checking that. Have you tried to update only that single folder? |
Yes, I've also tried that. Same result. |
It looks like track info are not written to |
After several hours of debugging, phpmyadmin analysis and understanding the code, I finally found the problem. If I remove the audio_encoder line from the SQL track update, then suddenly all the failing albums are importing correctly! So, in short: it seems that the SQL track update is currently escaping all the strings (real_escape_string) but that's still not making sure that they don't contain dodgy characters. My php knowledge is not up to the level of suggesting a solution: might there be a built-in function that strips such characters? In parallel to this, it might be worthwhile to add a check to see whether that SQL query succeeds or not. If it fails, you could print something to the update_log.txt file and also remove the placeholder track entry that was already created before (just containing the filename and the album reference). These almost-empty entries are causing the strange symptoms described above in the post of @uriel1998 . I can try to see if I have time to brush up on my php, and make a pull request for this. But no guarantees. NB: It seems that the dodgy characters are produced by LAME encoder version 3.100 (or perhaps by improper parsing of getId3, which I doubt). I haven't been able to find a way to modify the LAME encoder version field in the mp3 files themselves, so screening for dodgy characters in the update routine might be the only way to solve this without re-encoding the MP3s. |
Great work - thanks for investigating. I tried to reproduce this error in my system - I used LAME 3.100 for Windows (64bit) to create mp3 file. Indeed, it placed some strange character(s?) in |
Here is an example of a file that fails to be imported on my setup. (I had to zip the mp3 file): I've added some code to check that the mysqli_query indeed fails on this track. Also, in the database the track entry only contains the path and the album reference. NB: If I apply the trick where I don't add the encoder to the query, then this track imports ok with metadata such as "Unknown Artist" etc. in the database. |
Bingo, I've found the problem: it's a bug in the getID3 package! That package is checking the following (line 723 of module.audio.mp3.php: Anyway, if I manually change the if-statement to be I will file a bug report in the getID3 github repo. In the meantime, since you are using a local copy of getID3, it might be possible to patch it locally in OMPD? |
I used file you attached above: in my case there were no problems with import - strange. But in 80e12fe I modified |
I just checked: 80e12fe indeed solves the problem! I can import all failing albums now without any workarounds. |
We should close this ? |
I was puzzled why so many of my albums didn't contain full details, like track names for example even after a full update. I don't know the cause yet but wanted to start this ticket to get your guidance on debugging it. I've logged into my MPD player which is moode audio running on a raspberrypi and tailed the /var/log/mpd/mpd.log file while the re-indexing was happening. Everything goes well for awhile with each track been listed in the mpd log but then all of a sudden the log just stops and no further albums are indexed. Oddly the update on OMPD carries on happily until the end.
So I'm not fully aware of the relationship between the two, how can I debug what is happening here? Thanks
The text was updated successfully, but these errors were encountered: