Add bindings for discid/release-list.
This commit is contained in:
parent
2f2fe392d1
commit
c65b270799
|
@ -24,6 +24,7 @@ require "musicbrainz/models/track"
|
|||
require "musicbrainz/bindings/artist"
|
||||
require "musicbrainz/bindings/artist_search"
|
||||
require "musicbrainz/bindings/artist_release_groups"
|
||||
require "musicbrainz/bindings/discid_releases"
|
||||
require "musicbrainz/bindings/relations"
|
||||
require "musicbrainz/bindings/release_group"
|
||||
require "musicbrainz/bindings/release_group_search"
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
module MusicBrainz
|
||||
module Bindings
|
||||
module DiscidReleases
|
||||
def parse(xml)
|
||||
xml.xpath('./disc/release-list/release').map do |xml|
|
||||
MusicBrainz::Bindings::Release.parse(xml)
|
||||
end
|
||||
end
|
||||
|
||||
extend self
|
||||
end
|
||||
end
|
||||
end
|
|
@ -28,8 +28,8 @@ module MusicBrainz
|
|||
end
|
||||
|
||||
def find_by_discid(id)
|
||||
client.load(:discid, { id: id, inc: [:media, :release_groups] }, {
|
||||
binding: :release_group_releases,
|
||||
client.load(:discid, { id: id }, {
|
||||
binding: :discid_releases,
|
||||
create_models: :release
|
||||
})
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue