Permalink
Browse files

A slightly better fix

  • Loading branch information...
1 parent ad04d25 commit ee4f466b0e93faa43da9970cfd8815c26e70d417 @Giftie committed May 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 resources/lib/musicbrainz_utils.py
@@ -78,7 +78,7 @@ def get_musicbrainz_album( album_title, artist, e_count, limit=1, with_singles=F
url = release_group_url_using_release_name % ( quote_plus( album_title.encode("utf-8") ), quote_plus( artist.encode("utf-8") ), limit )
htmlsource = get_html_source( url, "", False )
if limit == 1:
- match = re.search( '''<release-group ext:score="(.*?)" type="(.*?)" id="(.*?)"><primary-type>(?:.*?)</primary-type><title>(.*?)</title>(?:.*?)<artist id="(.*?)"><name>(.*?)</name><sort-name>(.*?)</sort-name>(?:.*?)</release-group>''', htmlsource )
+ match = re.search( '''<release-group ext:score="(.*?)" type="(.*?)" id="(.*?)">(?:.*?)<title>(.*?)</title>(?:.*?)<artist id="(.*?)"><name>(.*?)</name><sort-name>(.*?)</sort-name>(?:.*?)</release-group>''', htmlsource )
if match:
album["artist"] = match.group(6)
album["artist_id"] = match.group(5)

4 comments on commit ee4f466

I could help you get rid of the whole reg-ex and move to JSON which is IMO a lot easier to use.

Owner

Giftie replied May 19, 2012

This is for MusicBrainz, not fanart.tv. They decided to add 'primary-type' in the last week.

heh silly me. I knew it was MusicBrainz but was mistaken about the JSON.
Reg-ex is not my kind of thing. I rather stay away from it

Owner

Giftie replied May 19, 2012

reg-ex can be confusing.. I use Regex Buddy to work everything out..

Please sign in to comment.