From 38849a1c443691b7cf9d9e795b8ce4f89adcdd3d Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 19 Feb 2015 15:56:42 -0600 Subject: [PATCH] VRFS-2804 - fix code to find the jamtrack ID correctly based on recent client changes --- web/app/assets/javascripts/session.js | 11 +++-------- web/lib/tasks/sample_data.rake | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/web/app/assets/javascripts/session.js b/web/app/assets/javascripts/session.js index 3a759149c..364f9ce9e 100644 --- a/web/app/assets/javascripts/session.js +++ b/web/app/assets/javascripts/session.js @@ -1100,19 +1100,14 @@ // find the track or tracks that correspond to the mixer var correspondingTracks = [] $.each(jamTracks, function(i, jamTrack) { - if(mixer.id.indexOf("L") == 0) { - if(mixer.id.substring(1) == jamTrack.id) { + if(mixer.id == jamTrack.id) { correspondingTracks.push(jamTrack); } - else { - // this should not be possible - alert("Invalid state: the backing track had neither persisted_track_id or persisted_client_id"); - } - } }); if(correspondingTracks.length == 0) { noCorrespondingTracks = true; + logger.error("could not correlate jam tracks", jamTrackMixers, jamTracks) app.notify({ title: "Unable to Open JamTrack", text: "Could not correlate server and client tracks", @@ -2357,7 +2352,7 @@ downloadJamTrack = null } - downloadJamTrack = new context.JK.DownloadJamTrack(app, jamTrack.id, 'large'); + downloadJamTrack = new context.JK.DownloadJamTrack(app, jamTrack, 'large'); // the widget indicates when it gets to any transition; we can hide it once it reaches completion $(downloadJamTrack).on(EVENTS.JAMTRACK_DOWNLOADER_STATE_CHANGED, function(e, data) { diff --git a/web/lib/tasks/sample_data.rake b/web/lib/tasks/sample_data.rake index ff107ac00..c19d46dea 100644 --- a/web/lib/tasks/sample_data.rake +++ b/web/lib/tasks/sample_data.rake @@ -1,6 +1,6 @@ require 'factory_girl' require 'open-uri' -require './spec/factories.rb' # useful when run on a server +#require './spec/factories.rb' # useful when run on a server namespace :db do desc "Add a simple one track recording to the database"