Managed Hosting



(I want my) lastfm
Project Home Blog Forums Known Issues External Project Link Contact Project

(I want my) lastfm Issue: Artist.cfc - incomplete image metadata being captured.

Name: Artist.cfc - incomplete image metadata being captured.
ID: 2
Project: (I want my) lastfm
Type: Bug
Area: Code
Severity: Low
Status: Open
Related URL:
Creator: Kerr
Created: 12/30/10 4:25 PM
Updated: 07/31/11 11:31 PM
Description: Firstly, thanks so much for publishing this work. I've created a similar API wrapper in PHP, and I ran into so many issues dealing with the particulars of each API call that I elected to dynamically parse the incoming XML into either nested associative arrays or a PHP stdClass object. This helps a lot when the last.fm developers decide to change what's returned via API calls (more common than I initially thought) and/or add new API calls. That said, I understand the desire to parse out specific items and return meaningful information using structs in ColdFusion.

In Artist.cfc, lines 258-259 dealing with parsing of the artist image array is only capturing the first element in the array, five times. This results in the information for the "small" image being stored 5x, rather than small, medium, large, extralarge and mega image information being stored. The fix is very easy.

<cfset stuArtistImage.url = resultNodes[artistmatches].image.XmlText>
<cfset stuArtistImage.size = resultNodes[artistmatches].image.XmlAttributes.size>

Should be:
<cfset stuArtistImage.url = resultNodes[artistmatches].image[artistimage].XmlText>
<cfset stuArtistImage.size = resultNodes[artistmatches].image[artistimage].XmlAttributes.size>

Basically, the current position of the array needs to be referenced, and that's it! I'm not sure if carets are parsed correctly by this tracker. If not, I can send code separately. Conversely, the similar artist image array loop on lines 275-276 can be used as a template as it parses image info without issue.
History: Created by haylo75 (Kerr) : 12/30/10 4:25 PM

Comment by haylo75 (Kerr) : 12/30/10 4:25 PM
Cool, carets are in fact parsed correctly. ;)

Comment by jiexl583 (jiehao) : 07/31/11 11:31 PM
line store, people can have extra inventory. Cheap coach bags fashion world is a worthy introduction. There are many other options. <a href="http://www.worldbrandbags.com/cheap-dolce-gabbana-handbags-c-25.html">Cheap Dolce Gabbana handbags</a> One can store discount bags. In each season a lot of new product introduction, &quot;coach&quot; is a leading designer and has no formal <a href="http://www.worldbrandbags.com">cheap purses on sale</a>&nbsp; coach outlet store.</p>

To add a comment to this bug, please login using the link above.