ifl0w / RandomWallpaperGnome3

Random Wallpapers for Gnome 3
MIT License
178 stars 42 forks source link

Windows Spotlight requires parsing a JSON string (inside JSON) #211

Open DarkGhostHunter opened 1 month ago

DarkGhostHunter commented 1 month ago

After checking the Windows Spotlight API, the path $.batchrsp.items[@random].item contains a string that is JSON, where the image is contained.

When using $.batchrsp.items[@random].item.ad.landscapeImage.asset, the image is not retrieved because the string is not JSON itself, it has to be parsed first.

A way to fix this is to allow the JSON string to be evaluated as JSON by enclosing the string path with {} (or any other alternative).

$.batchrsp.items[@random].item:{$.ad.landscapeImage.asset}

This would also fix any offending API that returns a JSON string.