2015-02-13 08:16:48 +00:00
|
|
|
object @profile
|
|
|
|
|
|
|
|
|
|
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :follower_count, :following_count, :recording_count, :session_count, :biography, :favorite_count, :audio_latency, :upcoming_session_count, :age, :website, :skill_level, :concert_count, :studio_session_count, :virtual_band, :virtual_band_commitment, :traditional_band, :traditional_band_commitment, :traditional_band_touring, :paid_sessions, :paid_sessions_hourly_rate,
|
2025-05-11 06:29:07 +00:00
|
|
|
:paid_sessions_daily_rate, :free_sessions, :cowriting, :cowriting_purpose, :subscribe_email, :is_a_teacher, :is_a_student, :last_active_timestamp, :v2_photo_url, :v2_photo_uploaded, :first_downloaded_client_at
|
2015-02-13 08:16:48 +00:00
|
|
|
|
2015-02-14 03:45:19 +00:00
|
|
|
child :online_presences => :online_presences do
|
2015-02-13 08:16:48 +00:00
|
|
|
attributes :id, :service_type, :username
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
child :performance_samples => :performance_samples do
|
2015-02-27 03:33:53 +00:00
|
|
|
attributes :id, :url, :service_type, :claimed_recording_id, :service_id, :description
|
2015-02-13 08:16:48 +00:00
|
|
|
|
|
|
|
|
child :claimed_recording => :claimed_recording do
|
2015-03-23 20:27:36 +00:00
|
|
|
attributes :id, :name
|
2015-02-13 08:16:48 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
child :genre_players => :genres do
|
2021-11-24 04:21:28 +00:00
|
|
|
attributes :genre_id, :player_type, :genre_type, :description
|
2015-02-22 04:26:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
child :band_musicians => :bands do
|
2022-01-11 10:49:39 +00:00
|
|
|
attributes :id, :name, :admin, :photo_url, :logo_url, :website
|
2015-02-22 04:26:08 +00:00
|
|
|
|
|
|
|
|
child :genres => :genres do
|
|
|
|
|
attributes :id, :description
|
|
|
|
|
#partial('api_genres/index', :object => @user.bands.genres)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
child :musician_instruments => :instruments do
|
|
|
|
|
attributes :description, :proficiency_level, :priority, :instrument_id
|
2016-01-15 17:59:55 +00:00
|
|
|
end
|
|
|
|
|
|
2023-01-19 23:20:27 +00:00
|
|
|
# node :last_active_timestamp do |user|
|
|
|
|
|
# if user.updated_at || user.last_jam_updated_at
|
|
|
|
|
# [user.updated_at, user.last_jam_updated_at].compact.max.to_i
|
|
|
|
|
# end
|
|
|
|
|
# end
|
2021-08-31 18:25:15 +00:00
|
|
|
|
|
|
|
|
node :created_at_timestamp do |user|
|
|
|
|
|
user.created_at.to_i
|
|
|
|
|
end
|
|
|
|
|
|
2016-01-15 17:59:55 +00:00
|
|
|
if @show_teacher_profile && @profile && @profile.teacher
|
|
|
|
|
node :teacher do
|
|
|
|
|
partial("api_teachers/detail", :object => @profile.teacher)
|
|
|
|
|
end
|
|
|
|
|
end
|
2016-02-08 17:45:11 +00:00
|
|
|
|
|
|
|
|
if current_user && @profile != current_user
|
|
|
|
|
node :is_friend do |uu|
|
|
|
|
|
current_user.friends?(uu)
|
|
|
|
|
end
|
|
|
|
|
node :is_following do |uu|
|
|
|
|
|
current_user.following?(uu)
|
|
|
|
|
end
|
|
|
|
|
node :is_liking do |uu|
|
|
|
|
|
current_user.likes?(uu)
|
|
|
|
|
end
|
|
|
|
|
node :pending_friend_request do |uu|
|
|
|
|
|
current_user.pending_friend_request?(uu)
|
|
|
|
|
end
|
|
|
|
|
node :my_audio_latency do |user|
|
|
|
|
|
current_user.last_jam_audio_latency.round if current_user.last_jam_audio_latency
|
|
|
|
|
end
|
|
|
|
|
node :internet_score do |user|
|
|
|
|
|
current_user.score_info(user)
|
|
|
|
|
end
|
|
|
|
|
end
|