Hello everyone,
I think there is a bug with version 3.22, on the json_select_many
function. I'll try to explain in detail:
- using my own script to parse json formatted data from iTunes API, on
[ParserScriptAlbum]
I usejson_select_many
to get the "contentAdvisoryRating" value for each track, which classifies it as explicit or not. It's important to note that the "contentAdvisoryRating" key is only present if that track is considered explicit and absent if it is not. In a simple example, the raw data from the API would be something like:
{"wrapperType":"track", "trackName":"one", "trackNumber":1, "contentAdvisoryRating":"Explicit"},
{"wrapperType":"track", "trackName":"two", "trackNumber":2},
{"wrapperType":"track", "trackName":"three", "trackNumber":3},
{"wrapperType":"track", "trackName":"four", "trackNumber":4, "contentAdvisoryRating":"Explicit"},
{"wrapperType":"track", "trackName":"five", "trackNumber":5, "contentAdvisoryRating":"Explicit"},
where tracks 1, 4, 5 are explicit and 2, 3 are not. Again, what's important in this example is that in this json array, some elements have the "contentAdvisoryRating" key and some do not.
On version 3.21:
Using the command json_select_many "results" "contentAdvisoryRating" "|" the respective output for the above example would be:
output["TAG"]= Explicit | | | Explicit | Explicit
- one "explicit" value followed by a separator " | " a "blank" value followed by a separator " | " another "blank" value followed by a separator " | " one "explicit" value followed by a separator " | " another "explicit" value >>>>> this is desired.
On version 3.22:
The same command on the same data outputs:
output["TAG"]= Explicit | Explicit | Explicit
- one "explicit" value followed by " | " another "explicit" value followed by " | " and another "explicit" value >>>> this is NOT desired
This is just a simple example that represents the problem as I am able to identify it. From my understanding json_select_many
is ignoring absent keys instead of assigning 'blank' values to the output. I'm also unsure if other json-related functions are also having troubles.
Can anyone else replicate this problem? Is it a bug?
Thank you.