Help with Lua #11
-
myMPD version: 8.1.5 Hi, I need some help on using Lua. The following scripts where working as intended when the interpreter appeared in previous versions, but now they have some issues I would like to understand. Both this script run in alternative way. One replace the other at different time of the day. `-- {"order":1,"arguments":[]} mympd_api("MYMPD_API_PLAYER_OPTIONS_SET", "jukeboxMode", "1")
`-- {"order":2,"arguments":[]} --mympd = { _version = "0.2.0" } mympd_api("MYMPD_API_PLAYER_STOP") This script has the following problems:
Also, this one does stop at the last instruction. Could you please point me in the right direction ? I don't understand why this is working in some cases and not in others. Maybe there is indentation rules in lua? thanks for any help Thaihugo |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 6 replies
-
The scripts are looking good. You can combine the MYMPD_API_PLAYER_OPTIONS_SET calls in one call, just append the key/value pairs.
This is a bug - the ui shows always song, even if you change it in the ui. This is now fixed with commit 39cbdb17fba21a0cf000848297e25b08d02ad0c4. Please provide debug logs of myMPD and verbose logs of MPD.
I do not understand, can you describe this more verbose? How many songs the jukebox adds? I do not understand why do you need the queue shuffle? |
Beta Was this translation helpful? Give feedback.
-
Thanks. My understanding is that:
The playlist used here is small. Probably 20-30 albums. When using this exact script without the queue shuffle, the same songs will appear in the list, everyday. With the other script working on the full library, I will get new songs each time it is launched. I always had randomness problems, like a few song seems to be repeated too much statistically compared to my music collection. But the small playlist is definitely not randomized when this script insert it in the jukebox. |
Beta Was this translation helpful? Give feedback.
-
Here are the log. The issue with the player not stopping is happening in this log. Also, the second playlist has a new selection which is not random actions:
hope this help you see the issue. thanks Thaihugo |
Beta Was this translation helpful? Give feedback.
-
Thanks for the logs. I will look into it. Concerning the randomness issue:
This could not produce a random list. The jukebox uses reservoir sampling to create the internal jukebox queue with 50 entries. From this internal queue the mpd queue is filled. Because you have uniq tag set to album, from each album only the first song is considered to be added and the first albums are always added because the jukebox tries to fill up to 50 entries. You should not use uniq tag album if there are only a few albums in the playlist. The log shows the respectively messages:
The ui uses exactly the same api as the your script. You can see the exact api calls with developer console of your browser. |
Beta Was this translation helpful? Give feedback.
-
Concerning the not stopping issue:
You should disable autoplay. |
Beta Was this translation helpful? Give feedback.
-
This is much clearer now. I didn't realize the autoplay was on by default, and I did reinstall Mympd from scratch lately. Thanks a lot for your great help. |
Beta Was this translation helpful? Give feedback.
Concerning the not stopping issue:
You should disable autoplay.