2012-07-08 19:46:09 +00:00
|
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
|
|
|
|
module MusicBrainz
|
|
|
|
module Parsers
|
|
|
|
class ReleaseGroup < Base
|
|
|
|
class << self
|
|
|
|
def model(xml)
|
|
|
|
{
|
2012-07-08 21:19:56 +00:00
|
|
|
:id => safe_get_attr(xml, nil, "id") || safe_get_attr(xml, "release-group", "id"),
|
|
|
|
:type => safe_get_attr(xml, nil, "type") || safe_get_attr(xml, "release-group", "type"),
|
2012-07-08 19:46:09 +00:00
|
|
|
:title => safe_get_value(xml, "title"),
|
|
|
|
:disambiguation => safe_get_value(xml, "disambiguation"),
|
|
|
|
:first_release_date => safe_get_value(xml, "first-release-date")
|
|
|
|
}
|
|
|
|
end
|
2012-07-08 21:19:56 +00:00
|
|
|
|
|
|
|
def releases(xml)
|
|
|
|
releases = []
|
|
|
|
xml.css("release").each do |r|
|
|
|
|
releases << MusicBrainz::Parsers::Release.model(r)
|
|
|
|
end
|
|
|
|
releases
|
|
|
|
end
|
2012-07-08 19:46:09 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|