object @band

attributes :id, :name, :city, :state, :country, :location, :website, :biography, :photo_url, :logo_url, :liker_count, :follower_count, :recording_count, :session_count,
:original_fpfile_photo, :cropped_fpfile_photo, :crop_selection_photo,
:band_type, :band_status, :concert_count, :add_new_members, :play_commitment, :touring_option, :paid_gigs, 
:free_gigs, :hourly_rate, :gig_minimum

child :users => :musicians do
  attributes :id, :first_name, :last_name, :name, :photo_url

  # TODO: figure out how to omit empty arrays
  node :instruments do |user|
    unless user.instruments.nil? || user.instruments.size == 0
      child :musician_instruments => :instruments do
        attributes :instrument_id, :description, :proficiency_level, :priority
      end
    end
  end
end

child :instruments => :instruments do
  attributes :id, :instrument_id, :proficiency_level
end

child :genres => :genres do
  attributes :id, :description
  #partial('api_genres/index', :object => @band.genres)
end

child :performance_samples => :performance_samples do
  attributes :id, :url, :service_type, :claimed_recording_id, :service_id, :description

  child :claimed_recording => :claimed_recording do
    attributes :id, :name
  end
end

child :online_presences => :online_presences do
  attributes :id, :service_type, :username
end

if current_user
  node :is_following do |uu|
    current_user.following?(@band)
  end
  node :is_liking do |uu|
    current_user.likes?(@band)
  end
end