kevinmehall/pithos — pull request #9 by chrismendoza (2013-01-12 02:27:09+00:00)
Title: Fix song tiles for tracks from album scores

For some reason, pandora doesn't return the correct songName (and in fact returns a modified version of the album name instead) when dealing with tracks from film scores, but does return them correctly (with additional fluff) in the XML returned by the songExplorerUrl (and the correct name, stripped of various characters is actually in the songExplorerUrl).

This change compares the songName to the name in the songExplorerUrl, and if the stripped versions do not match, pulls down the xml, and grabs the title from the xml, caches it on the song object, and returns that title instead, falling back on the song title provided by pandora if any error should occur while grabbing the xml or parsing the attribute.

Some examples:
Pandora returns "Star Wars, Episode V: The Empire Strikes Back, Film Score" for every track on "Empire Strikes Back (Film Score), John Williams - Greatest Hits 1969 - 1999".

Pandora returns "Avatar, Film Score" for ever track on the album "Avatar (Film Score), Avatar".