diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb
index 49e8bc420..ca124b65a 100644
--- a/ruby/lib/jam_ruby/models/music_session_history.rb
+++ b/ruby/lib/jam_ruby/models/music_session_history.rb
@@ -111,7 +111,7 @@ module JamRuby
end
def self.save(music_session)
- session_history = MusicSessionHistory.find_by_music_session_id(music_session.id)
+ session_history = MusicSessionHistory.find(music_session.id)
if session_history.nil?
session_history = MusicSessionHistory.new
diff --git a/web/app/assets/javascripts/hoverMusician.js b/web/app/assets/javascripts/hoverMusician.js
index d4ac48b67..2789981b0 100644
--- a/web/app/assets/javascripts/hoverMusician.js
+++ b/web/app/assets/javascripts/hoverMusician.js
@@ -47,7 +47,6 @@
var sessionDisplayStyle = 'none';
var sessionId = '';
- console.log("here");
if (response.sessions !== undefined && response.sessions.length > 0) {
sessionDisplayStyle = 'block';
sessionId = response.sessions[0].id;
diff --git a/web/app/assets/javascripts/hoverRecording.js b/web/app/assets/javascripts/hoverRecording.js
index 46f7d05bd..de4780d74 100644
--- a/web/app/assets/javascripts/hoverRecording.js
+++ b/web/app/assets/javascripts/hoverRecording.js
@@ -15,35 +15,42 @@
rest.getClaimedRecording(recordingId)
.done(function(response) {
+ var claimedRecording = response;
+ var recording = response.recording;
$(hoverSelector).html('');
// musicians
var musicianHtml = '';
- $.each(response.musicians, function(index, val) {
+ $.each(recording.recorded_tracks, function(index, val) {
var instrumentHtml = '';
+ var musician = val.user;
- musicianHtml += '
 + ') | ';
- musicianHtml += '' + val.name + ' | ';
+ musicianHtml += '
 + ') | ';
+ musicianHtml += '' + musician.name + ' | ';
instrumentHtml = '';
- $.each(val.instruments, function(index, instrument) {
- instrumentHtml += '  ';
- });
-
+ instrumentHtml += '  ';
instrumentHtml += ' | ';
-
+
musicianHtml += instrumentHtml;
musicianHtml += '
';
});
var template = $('#template-hover-recording').html();
+ var creator = recording.band == null ? recording.owner : recording.band;
var recordingHtml = context.JK.fillTemplate(template, {
- avatar_url: context.JK.resolveAvatarUrl(response.photo_url),
- name: response.name,
- location: response.location,
- friend_count: response.friend_count,
- follower_count: response.follower_count
+ name: claimedRecording.name,
+ genre: claimedRecording.genre_id.toUpperCase(),
+ created_at: context.JK.formatDateTime(recording.created_at),
+ description: response.description,
+ play_count: recording.play_count,
+ comment_count: recording.comment_count,
+ like_count: recording.like_count,
+ creator_avatar_url: recording.band === null ? context.JK.resolveAvatarUrl(creator.photo_url) : context.JK.resolveBandAvatarUrl(creator.photo_url),
+ creator_name: creator.name,
+ location: creator.location,
+ musicians: musicianHtml
});
$(hoverSelector).append('Recording Detail
' + recordingHtml);
diff --git a/web/app/assets/javascripts/hoverSession.js b/web/app/assets/javascripts/hoverSession.js
index e09845841..aadbc8cad 100644
--- a/web/app/assets/javascripts/hoverSession.js
+++ b/web/app/assets/javascripts/hoverSession.js
@@ -22,12 +22,13 @@
$.each(response.users, function(index, val) {
var instrumentHtml = '';
- musicianHtml += ' + ') | ';
- musicianHtml += '' + val.name + ' | ';
+ musicianHtml += '
 + ') | ';
+ musicianHtml += '' + val.user.name + ' | ';
instrumentHtml = '';
- $.each(val.instruments, function(index, instrument) {
- instrumentHtml += '  ';
+ var instruments = val.instruments.split("|");
+ $.each(instruments, function(index, instrument) {
+ instrumentHtml += '  ';
});
instrumentHtml += ' | ';
@@ -39,6 +40,12 @@
var template = $('#template-hover-session').html();
var sessionHtml = context.JK.fillTemplate(template, {
+ description: response.description,
+ genre: response.genres.toUpperCase(),
+ comment_count: response.comment_count,
+ like_count: response.like_count,
+ created_at: context.JK.formatDateTime(response.created_at),
+ musicians: musicianHtml
});
$(hoverSelector).append('Session Detail
' + sessionHtml);
diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js
index 0f201e145..c907ae3bd 100644
--- a/web/app/assets/javascripts/utils.js
+++ b/web/app/assets/javascripts/utils.js
@@ -342,7 +342,7 @@
context.JK.formatDateTime = function(dateString) {
var date = new Date(dateString);
- return date.getFullYear() + "-" + context.JK.padString(date.getMonth()+1, 2) + "-" + context.JK.padString(date.getDate(), 2) + " @ " + date.toLocaleTimeString();
+ return context.JK.padString(date.getMonth()+1, 2) + "/" + context.JK.padString(date.getDate(), 2) + "/" + date.getFullYear() + " - " + date.toLocaleTimeString();
}
// returns Fri May 20, 2013
diff --git a/web/app/controllers/api_music_sessions_controller.rb b/web/app/controllers/api_music_sessions_controller.rb
index 984443712..94145359c 100644
--- a/web/app/controllers/api_music_sessions_controller.rb
+++ b/web/app/controllers/api_music_sessions_controller.rb
@@ -195,7 +195,7 @@ class ApiMusicSessionsController < ApiController
# example of using curl to access this API:
# curl -L -T some_file -X PUT http://localhost:3000/api/sessions/[SESSION_ID]/perf.json?client_id=[CLIENT_ID]
- music_session_history = MusicSessionHistory.find_by_music_session_id(params[:id])
+ music_session_history = MusicSessionHistory.find(params[:id])
msuh = MusicSessionUserHistory.find_by_client_id(params[:client_id])
@perfdata = MusicSessionPerfData.new
@@ -293,7 +293,7 @@ class ApiMusicSessionsController < ApiController
end
def history_show
- @history = MusicSessionHistory.find_by_music_session_id(params[:id])
+ @history = MusicSessionHistory.find(params[:id])
end
def claimed_recording_start
diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb
index 59ac5c6fd..fe313c9f0 100644
--- a/web/app/controllers/api_users_controller.rb
+++ b/web/app/controllers/api_users_controller.rb
@@ -554,7 +554,7 @@ class ApiUsersController < ApiController
def share_session
provider = params[:provider]
music_session_id = params[:music_session]
- history = MusicSessionHistory.find_by_music_session_id!(music_session_id)
+ history = MusicSessionHistory.find!(music_session_id)
if provider == 'facebook'
diff --git a/web/app/controllers/music_sessions_controller.rb b/web/app/controllers/music_sessions_controller.rb
index 7087fdaad..b40914178 100644
--- a/web/app/controllers/music_sessions_controller.rb
+++ b/web/app/controllers/music_sessions_controller.rb
@@ -3,7 +3,7 @@ class MusicSessionsController < ApplicationController
respond_to :html
def show
- @music_session = MusicSessionHistory.find_by_music_session_id(params[:id])
+ @music_session = MusicSessionHistory.find(params[:id])
render :layout => "web"
end
diff --git a/web/app/views/api_claimed_recordings/show.rabl b/web/app/views/api_claimed_recordings/show.rabl
index 1db99c371..9426d607e 100644
--- a/web/app/views/api_claimed_recordings/show.rabl
+++ b/web/app/views/api_claimed_recordings/show.rabl
@@ -16,11 +16,11 @@ child(:recording => :recording) {
attributes :id, :created_at, :duration, :comment_count, :like_count, :play_count
child(:band => :band) {
- attributes :id, :name, :photo_url
+ attributes :id, :name, :location, :photo_url
}
child(:owner => :owner) {
- attributes :id, :name, :photo_url
+ attributes :id, :name, :location, :photo_url
}
child(:mixes => :mixes) {
@@ -31,7 +31,7 @@ child(:recording => :recording) {
attributes :id, :fully_uploaded, :url, :client_track_id, :client_id, :instrument_id
child(:user => :user) {
- attributes :id, :first_name, :last_name, :name, :city, :state, :country, :photo_url
+ attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :photo_url
}
}
diff --git a/web/app/views/api_music_sessions/history_show.rabl b/web/app/views/api_music_sessions/history_show.rabl
index 9d3ea1c81..841e427d5 100644
--- a/web/app/views/api_music_sessions/history_show.rabl
+++ b/web/app/views/api_music_sessions/history_show.rabl
@@ -1,6 +1,6 @@
object @history
-attributes :music_session_id, :description, :genres, :created_at
+attributes :id, :music_session_id, :description, :genres, :like_count, :comment_count, :created_at
node :share_url do |history|
unless history.share_token.nil?
diff --git a/web/app/views/clients/_hoverRecording.html.erb b/web/app/views/clients/_hoverRecording.html.erb
index a6c2415ec..22af21705 100644
--- a/web/app/views/clients/_hoverRecording.html.erb
+++ b/web/app/views/clients/_hoverRecording.html.erb
@@ -4,7 +4,7 @@