2013-11-06 02:15:09 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-10-12 12:45:51 +00:00
|
|
|
module MusicBrainz
|
|
|
|
module Bindings
|
|
|
|
module ReleaseGroup
|
|
|
|
def parse(xml)
|
|
|
|
xml = xml.xpath('./release-group') unless xml.xpath('./release-group').empty?
|
|
|
|
{
|
|
|
|
id: (xml.attribute('id').value rescue nil),
|
|
|
|
type: (xml.attribute('type').value rescue nil),
|
|
|
|
title: (xml.xpath('./title').text rescue nil),
|
|
|
|
desc: (xml.xpath('./disambiguation').text rescue nil),
|
2013-06-14 10:33:35 +00:00
|
|
|
first_release_date: (xml.xpath('./first-release-date').text rescue nil)
|
|
|
|
}.merge(Relations.parse(xml))
|
2012-10-12 12:45:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
extend self
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|