[Not my release] Biography view
Reply #470 – 2012-07-11 23:16:26
Redownloading did it! My script was apparently corrupted in a manner not visually evident. Since it just happened again and going back to a pristine copy fixed it again, I need to rethink my tweaking approach - I use Notepad as an editor and tweak the script while foobar2000 is running, and try a new or revised script by playing a different album to trigger the script. That worked....until it didn't. I'll try tweaking scripts when foobar2000 is not running going forward. More interestingly, what I was experimenting with: I have quite a few jazz and classical albums for which allmusic will associate with multiple artists. I pass my album artist and album tag fields to the script to retrieve the bio and review. The script looks for that artist on the allmusic album search result webpage. If that artist is in the search result for dl-tagged elements, the script always finds the right album and assigns the album_link variable to the right album. Everything is perfect so far. But the script then assigns the artist_link variable to the first artist link it encounters under that album, even if that artist is not the artist that I passed to the script and for whom I want a bio. For example, I have Charlie Haden as my album artist for the the album "Alone Together", which returns the search result of http://www.allmusic.com/search/albums/alone+together Note that Charlie is listed second in the html source per the relevant extract from the search result: <dl class="info small"> <dd class="artist secondary_link"> <a href="http://www.allmusic.com/artist/brad-mehldau-mn0000934305">Brad Mehldau</a> / <a href="http://www.allmusic.com/artist/charlie-haden-mn0000211483">Charlie Haden</a> / <a href="http://www.allmusic.com/artist/lee-konitz-mn0000227776">Lee Konitz</a> The script currently returns the bio of Brad Mehldau because Brad is listed first and the script command returns the first child result: artist_link = i.firstchild.firstchild.getAttribute("href") Given that, and since each artist link has the artist name as a label on its link, I tried to tweak this line to grab the link associated with the artist that I passed to the script instead of just grabbing the first position. So I need the script to find the href associated with ARG(0) and assign that link to artist_link. But my knowledge of how to use getAttribute is very slight and insufficient. Any suggestions appreciated as always.