X-Git-Url: http://git.hcoop.net/clinton/xbmc-groove.git/blobdiff_plain/c64c644c8947d11a07c2424f034fe0756b4211b8..3d755857ed05ca9ed03bac7b55b0d083d77781ca:/default.py diff --git a/default.py b/default.py index 2eba189..796d1da 100644 --- a/default.py +++ b/default.py @@ -355,7 +355,8 @@ class Grooveshark: if (query != ''): artists = groovesharkApi.getArtistSearchResults(query, limit = self.artistsearchlimit) if (len(artists) > 0): - artist = artists[0] + # check for artist name match, first result is sometimes not the closest lexical match + artist = next ((a for a in artists if a[0].lower() == query.lower()), artists[0]) artistID = artist[1] if __debugging__ : xbmc.log("Found " + artist[0] + "...") @@ -464,7 +465,11 @@ class Grooveshark: if (query != ''): artists = groovesharkApi.getArtistSearchResults(query, limit = self.artistsearchlimit) if (len(artists) > 0): - artist = artists[0] + # check for exact artist name match, sometimes a more + # popular artist is returned first (e.g. 'Angel Dust' + # gets you 'Faith No More' because of their popular + # album 'Angel Dust') + artist = next ((a for a in artists if a[0].lower() == query.lower()), artists[0]) artistID = artist[1] if __debugging__ : xbmc.log("Found " + artist[0] + "...")