diff --git a/web/app/controllers/api_jam_tracks_controller.rb b/web/app/controllers/api_jam_tracks_controller.rb index 13a6723a6..ff7cbf6f2 100644 --- a/web/app/controllers/api_jam_tracks_controller.rb +++ b/web/app/controllers/api_jam_tracks_controller.rb @@ -102,7 +102,6 @@ class ApiJamTracksController < ApiController if params[:mixcheck] checksum = JamTrackMixdown.mixdownChecksum(current_user.id, jtid) head :ok, checksum: checksum - return else # 204: nothing purchased for user # 200: jamtrack purchase for user confirmed @@ -111,21 +110,12 @@ class ApiJamTracksController < ApiController .limit(1) .blank? head(:no_content) - return end end - elsif params[:syncbuys] - syncbuys = params[:syncbuys].to_i - latestPurchase = JamTrack.latestPurchase(current_user.id) - if 0 == syncbuys || (0 < latestPurchase && (latestPurchase <= syncbuys)) - head :no_content, latestpurchase: latestPurchase - return - else - head :ok, latestpurchase: latestPurchase - return - end + elsif params[:syncbuys].present? + head :ok, purchasecount: JamTrackRight.where(user_id: current_user.id).count end - head(:ok) + head(:ok) unless performed? end def purchased