jcorporation / myMPD

myMPD is a standalone and mobile friendly web mpd client with a tiny footprint and advanced features.
https://jcorporation.github.io/myMPD/
GNU General Public License v3.0
418 stars 65 forks source link

Jukebox mode selects only from first 1000 songs in database mode #239

Closed thaihugo closed 4 years ago

thaihugo commented 4 years ago

MyMPd 6.2.3 Mpd protocol version: 0.21.4 Libmpdclient version: 2.19.0 Libmympdclient version: 1.0.2

Manual update on standard install 6.2.0 on dietpi Buster on raspberry pi 4 2gb

Mpd root is /mnt/ssd/Music There are 5 subfolders. All the music is parsed by mpd, and ssen by mympd. However, using the jukebox option with the "Database" source for content will give only music from the first folder in alphabetical list (Compilations in my case) All the smart playlist are generated using, at first glance, music from all folders.

As I cannot seem to be able to create a smart playlist myself (still trying to figure out the problem on my end before opening an issue) I cannot provide a new smart playlist to replace the database option.

Expected behavior: jukebox using database (default) option should get music from all folders in the database. This was the case in previous versions of mympd

Actual behavior: jukebox select music only from the first subfolder of the music database.

Thanks for any insight!

jcorporation commented 4 years ago

Please attach debug logs from myMPD and verbose logs from MPD.

Btw: You can save a search as a smart playlist.

thaihugo commented 4 years ago

Archive.zip

Here it is.

I've disabled smartplaylist, as it seems to struggle with the location folder, having full rights, creating the files but complaining about the fact it cannot write the file.

I've launched mympd, and refreshed the jukebox playlist. It seems it stop on the first folder because it is blocked in it's or mpd's scan process?

jcorporation commented 4 years ago

Thanks for the logs. The jukebox code in database mode iterates only through the first 1000 songs, thats a bug. It is now a untested fix in devel.

I've disabled smartplaylist, as it seems to struggle with the location folder, having full rights, creating the files but complaining about the fact it cannot write the file.

If you can't solve the problem, open another issue with appropriated infos and logs.

thaihugo commented 4 years ago

Thanks,

Does it means I should test it, or wait for 6.3.0?

I Can git clone the devel branch using this commands: git clone https://github.com/jcorporation/myMPD.git

git checkout devel

But I don't know where to find the build script.

jcorporation commented 4 years ago

You could test it if you want. The build.sh script is in the root of the checked out repository.

thaihugo commented 4 years ago

Ok, I've tested it and my method is to clear the playlist to get a new jukebox selection. On the first time, I get new music from everywhere, then if I clear more times, it goes back to the same selection for the first 1000. I'm on devel, as I have a mount option in the menu that is not in release, and I've cleaned my cache

jcorporation commented 4 years ago

Please attach the myMPD debug logs.

thaihugo commented 4 years ago

Sorry about that. First pass is from everywhere (20 song limit) Delete the queue, next pass and subsequent are as before (with a strange obsession for the same tracks) mympdtaketwo.log.zip

jcorporation commented 4 years ago

I think I found the error, the used reservoir sampling method works only in the first pass correctly. I pushed the first version of the untested fix.

thaihugo commented 4 years ago

This fix is working for me. I will be testing further but initial tests are saying no more limitation.

Thanks a lot for your incredible work.

thaihugo commented 4 years ago

Also, is there any reason mympd would be complaining the playlist to be smaller than 50? I got a hang with mympd, but I cannot reproduce the bug.

jcorporation commented 4 years ago

Please post the complete log with the error.

thaihugo commented 4 years ago

Mympd basically hang if queue is under 50 songs. (In dev version) Here are mympd and mpd logs.

Archive.zip

jcorporation commented 4 years ago

It seems your selected playlist myMPDsmart-Genre-Downtempo is non-existent or empty.

myMPD now warns and disables the jukebox on error conditions.

thaihugo commented 4 years ago

yes, I'm not sure if it's the smart playlist, as I thought I disabled them before, but I certainly trust you judgment on this issue. For now, a 20 song jukebox is not blocking the system, so It is definitely not the simple fact to have too few songs. You can close this issue as the main cause is resolved on the dev version.

Thanks a lot