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"
|
||||||
require "musicbrainz/bindings/artist_search"
|
require "musicbrainz/bindings/artist_search"
|
||||||
require "musicbrainz/bindings/artist_release_groups"
|
require "musicbrainz/bindings/artist_release_groups"
|
||||||
|
require "musicbrainz/bindings/discid_releases"
|
||||||
require "musicbrainz/bindings/relations"
|
require "musicbrainz/bindings/relations"
|
||||||
require "musicbrainz/bindings/release_group"
|
require "musicbrainz/bindings/release_group"
|
||||||
require "musicbrainz/bindings/release_group_search"
|
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
|
end
|
||||||
|
|
||||||
def find_by_discid(id)
|
def find_by_discid(id)
|
||||||
client.load(:discid, { id: id, inc: [:media, :release_groups] }, {
|
client.load(:discid, { id: id }, {
|
||||||
binding: :release_group_releases,
|
binding: :discid_releases,
|
||||||
create_models: :release
|
create_models: :release
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue