* fix null mark by specifying client = true

This commit is contained in:
Seth Call 2016-01-16 20:54:22 -06:00
parent 2283317719
commit 491bc8cda5
2 changed files with 6 additions and 8 deletions

View File

@ -87,17 +87,17 @@ class ApiJamTrackMixdownsController < ApiController
if @package.ready?
fingerprint = params[:mark]
DownloadTracker.check(current_user, request.remote_ip, @package, !@jam_track_right.redeemed, fingerprint, jkclient_agent?)
@package.update_download_count
now = Time.now
@package.last_downloaded_at = now
@package.first_downloaded_at = now if @package.first_downloaded_at.nil?
@package.save!
if params[:download]
redirect_to @package.sign_url(120, 'application/octet-stream', "attachment; filename=\"#{@package.jam_track_mixdown.name}.#{params[:file_type]}\"")
if params[:download]
DownloadTracker.check(current_user, request.remote_ip, @package, !@jam_track_right.redeemed, params[:mark], false)
redirect_to @package.sign_url(120, 'application/octet-stream', "attachment; filename=\"#{@package.jam_track_mixdown.name}.#{params[:file_type]}\"")
else
DownloadTracker.check(current_user, request.remote_ip, @package, !@jam_track_right.redeemed, params[:mark], true)
redirect_to @package.sign_url(120)
end

View File

@ -166,13 +166,11 @@ class ApiJamTracksController < ApiController
jam_track_track = JamTrackTrack.find(params[:stem_id])
end
fingerprint = params[:mark]
DownloadTracker.check(current_user, request.remote_ip, jam_track_track, !@jam_track_right.redeemed, fingerprint, jkclient_agent?)
if params[:download]
DownloadTracker.check(current_user, request.remote_ip, jam_track_track, !@jam_track_right.redeemed, params[:mark], false)
redirect_to jam_track_track.web_download_sign_url(120, params[:file_type], 'application/octet-stream', "attachment; filename=\"#{@jam_track_right.jam_track.name + '-' + jam_track_track.display_name}.mp3\"")
else
DownloadTracker.check(current_user, request.remote_ip, jam_track_track, !@jam_track_right.redeemed, params[:mark], true)
redirect_to jam_track_track.web_download_sign_url(120, params[:file_type])
end