lib/parsers/artist.rb in musicbrainz-0.7.0 vs lib/parsers/artist.rb in musicbrainz-0.7.1
- old
+ new
@@ -19,22 +19,20 @@
}
res
end
def search(xml)
- artists = []
- xml.css("artist-list > artist").each do |a|
- artists << {
+ xml.css("artist-list > artist").map do |a|
+ {
:name => a.first_element_child.text.gsub(/[`’]/, "'"),
:sort_name => safe_get_value(a, "sort-name").gsub(/[`’]/, "'"),
- :weight => 0,
+ :score => (safe_get_attr(a, nil, "score").to_i rescue 0),
:desc => safe_get_value(a, "disambiguation"),
:type => safe_get_attr(a, nil, "type"),
:mbid => safe_get_attr(a, nil, "id"),
:aliases => a.css("alias-list > alias").map { |item| item.text }
}
end
- artists
end
def release_groups(xml)
release_groups = []
xml.css("release-group").each do |rg|