2015-01-04 22:24:24 +00:00
|
|
|
object @jam_track
|
2014-11-04 20:55:12 +00:00
|
|
|
|
2025-02-08 17:20:26 +00:00
|
|
|
attributes :id, :name, :description, :recording_type, :original_artist, :songwriter, :publisher, :sales_region, :price, :version, :duration, :year, :plan_code, :allow_free, :download_price, :upgrade_price,:slug, :original_artist_slug, :name_slug
|
2014-11-04 20:55:12 +00:00
|
|
|
|
|
|
|
|
node :genres do |item|
|
2015-08-09 18:37:43 +00:00
|
|
|
item.genres.select(:description).map(&:description)
|
2014-11-04 20:55:12 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
node :added_cart do |item|
|
2015-03-25 16:11:10 +00:00
|
|
|
any_user.shopping_carts.where(cart_id: item.id).count != 0
|
2014-11-04 20:55:12 +00:00
|
|
|
end
|
|
|
|
|
|
2017-02-05 20:42:51 +00:00
|
|
|
node :can_download do |item|
|
|
|
|
|
!!item.right_for_user(current_user, ShoppingCart::JAMTRACK_FULL)
|
|
|
|
|
end
|
|
|
|
|
|
2015-03-16 01:22:02 +00:00
|
|
|
node :purchased do |item|
|
|
|
|
|
!!item.right_for_user(current_user)
|
|
|
|
|
end
|
|
|
|
|
|
2014-11-04 20:55:12 +00:00
|
|
|
child(:jam_track_tracks => :tracks) {
|
2015-05-05 14:22:15 +00:00
|
|
|
attributes :id, :part, :instrument, :track_type, :position
|
2015-03-31 18:36:49 +00:00
|
|
|
|
|
|
|
|
node do |track|
|
|
|
|
|
{
|
|
|
|
|
preview_mp3_url: track.preview_public_url('mp3'),
|
2015-09-30 00:57:31 +00:00
|
|
|
preview_ogg_url: track.preview_public_url('ogg'),
|
|
|
|
|
preview_aac_url: track.preview_public_url('aac')
|
2015-03-31 18:36:49 +00:00
|
|
|
}
|
|
|
|
|
end
|
2014-11-04 20:55:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
child(:licensor => :licensor) {
|
|
|
|
|
attributes :id, :name
|
2025-02-08 17:20:26 +00:00
|
|
|
}
|