rboss
December 7, 2025, 4:38am
9
rboss:
The same (array name removed) commands on the unnamed variant:
Use "["a","b","c","d"]"
json "ON" "current"
json_select_array "" -1 ","
json_select_array "" 1
json_foreach ""
json_foreach_end
now returns
<empty> ##_ json_select_array "" -1 ","
<empty> ##_ json_select_array "" 1
4 ##_ json_foreach "" ---> (also number of literals in array)
On Mp3tag v3.33-beta.5 the results are now:
a,b,c,d ##_ json_select_array "" -1 ","
a ##_ json_select_array "" 1
4 ##_ json_foreach "" ---> (also number of literals in array)
Thank You very much @Florian .
Yes it does. And it's a godsend.
I know this because I remember (vividly) the exact bug that eventually led to this addition. If you're interested you can read about it here
Hello,
I have seen different descriptions of this bug in other topics,
but apparently in 3.24a it showed up again.
When working in JSON input mode, navigating to a nested array and using json_foreach will return the selected elements of that array correctly. However, after json_foreach_end the current pointer jumps to the root of the JSON data instead of the expected behavior of going up one level to the json object where said array is nested.
What I found additionally (and could not fin…
Before this we just had to mentally visualize (and believe) that the pointer would move where it was supposed to relative to its previous position during JSON data operations, which didn't always happened.