1
0
Fork 0

Add find_by_discid method.

This commit is contained in:
Dan Barber 2014-01-13 08:32:45 +00:00
parent d66831ee8c
commit 2f2fe392d1
1 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,7 @@ module MusicBrainz
field :asin, String field :asin, String
field :barcode, String field :barcode, String
field :quality, String field :quality, String
def tracks def tracks
@tracks ||= client.load(:release, { id: id, inc: [:recordings, :media], limit: 100 }, { @tracks ||= client.load(:release, { id: id, inc: [:recordings, :media], limit: 100 }, {
binding: :release_tracks, binding: :release_tracks,
@ -26,6 +26,13 @@ module MusicBrainz
create_model: :release create_model: :release
}) })
end end
def find_by_discid(id)
client.load(:discid, { id: id, inc: [:media, :release_groups] }, {
binding: :release_group_releases,
create_models: :release
})
end
end end
end end
end end