I used it with my own API, but that should make no difference. I will do some experiments with your script. Maybe I can get it going. If not, I will send you the debug. I will also report what chages got it going, if I get it going.
OK, it works. But only if I have the exact number of files as in the disogs release. I tested with only one file before.
That is a different behaviour as wiht the standard scripts which write TRACKS instead of TRACK and TITLE. Normally TRACKS gives the number of tracks to write, and you can see if your mp3 album misses some tracks.
With your script the number of files gives the number of tracks to write. So you don't see if the last tracks are missing, and you get strange results if you have more tracks than the discogs release. But at least you can see the number of total tracks. If you have less files than the discogs release has tracks, you still see the other tracks in the debug file, but not in the "Adjust tlbum information" window.
I will do further experiments with that new knowledge. Maybe we can get it going.