2013-09-11, 03:13
(2013-09-10, 13:07)McMuzz4 Wrote: My third test which I have put below is my solution - it will detect if a new song is playing that is a Spotify stream, and if so it will perform the JSON call once and store the response value in a variable. It will then use the stored JSON response to query artist information and not won't call the JSON API again until a different song starts playing
I like your idea of caching the JSON response not just for SpotifyMC, but generally. I really don't need to make JSON calls every time. I've updated AS using your code as a starting point so that it only makes one JSON call at the beginning and then uses the cached response until a different file is playing.
Here's the 1.5.5.001 beta with those fixes. I've tested it only to make sure it doesn't crash and that it behaves the same as 1.5.4 for normal uses.
https://github.com/pkscout/script.artist...deshow.zip
Let me know how this works for you.