2012-10-12 12:45:51 +00:00
|
|
|
module MusicBrainz
|
2013-01-20 12:36:52 +00:00
|
|
|
class Track < BaseModel
|
2012-10-12 12:45:51 +00:00
|
|
|
field :position, Integer
|
|
|
|
field :recording_id, String
|
|
|
|
field :title, String
|
|
|
|
field :length, Integer
|
|
|
|
|
|
|
|
class << self
|
|
|
|
def find(id)
|
2013-01-20 12:36:52 +00:00
|
|
|
client.load(:recording, { id: id }, {
|
|
|
|
binding: :track,
|
|
|
|
create_model: :track
|
2012-10-12 12:45:51 +00:00
|
|
|
})
|
|
|
|
end
|
2013-05-05 23:14:44 +00:00
|
|
|
|
|
|
|
def search(artist_name, track_name)
|
|
|
|
super({artist: artist_name, recording: track_name})
|
|
|
|
end
|
2012-10-12 12:45:51 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|