Merge branch 'promised_based_api_interation' of bitbucket.org:jamkazam/jam-cloud into promised_based_api_interation
This commit is contained in:
commit
20177f71dd
|
|
@ -60,7 +60,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def verify_download_count
|
||||
if (self.download_count < 0 || self.download_count > MAX_JAM_TRACK_DOWNLOADS) && !@current_user.admin
|
||||
if (self.download_count < 0 || self.download_count > MAX_JAM_TRACK_DOWNLOADS) && !self.user.admin
|
||||
errors.add(:download_count, "must be less than or equal to #{MAX_JAM_TRACK_DOWNLOADS}")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -214,10 +214,12 @@ class ApiJamTracksController < ApiController
|
|||
@jam_track_right.first_downloaded_at = now if @jam_track_right.first_downloaded_at.nil?
|
||||
@jam_track_right.save!
|
||||
|
||||
is_jamblaster = !!params[:is_jamblaster]
|
||||
#is_jamblaster = !!params[:is_jamblaster]
|
||||
|
||||
# if it's not the jamblaster, keep the URL https
|
||||
redirect_to @jam_track_right.sign_url(120, sample_rate, !is_jamblaster)
|
||||
# 2023: just kidding -- ignoring jamblaster code right now.
|
||||
# always send https url back to client
|
||||
redirect_to @jam_track_right.sign_url(120, sample_rate, true)
|
||||
else
|
||||
@jam_track_right.enqueue_if_needed(sample_rate)
|
||||
render :json => { :message => "not available, digitally signing Jam Track offline." }, :status => 202
|
||||
|
|
|
|||
Loading…
Reference in New Issue