Minor fixes

This commit is contained in:
magnolia-fan
2011-12-01 10:09:18 +04:00
parent f76dea062c
commit bc98085090
8 changed files with 50 additions and 26 deletions
@@ -59,6 +59,13 @@ module MusicBrainz
:type => self.safe_get_attr(a, nil, 'type'),
:mbid => self.safe_get_attr(a, nil, 'id')
}
if artist[:type] == "Group"
m = artist[:sort_name].match(/(.*?),\sThe$/)
artist[:name] = artist[:sort_name] = "The #{m[1]}" if m
elsif artist[:type] == "Person"
m = artist[:sort_name].match(/(.+?),\s([^,]+?)$/)
artist[:name] = artist[:sort_name] = "#{m[2]} #{m[1]}" if m
end
aliases = a.css('alias-list > alias').map{ |item| item.text }
if aliases.include? name
artist[:weight] += 20