mirror of
https://github.com/fergalmoran/dss.git
synced 2026-01-26 18:56:23 +00:00
Fixed broken downloads
This commit is contained in:
@@ -30,9 +30,8 @@ def download(request, mix_id):
|
||||
if mix is not None:
|
||||
if mix.download_allowed:
|
||||
mix.add_download(request.user)
|
||||
filename = mix.local_file.path # Select your file here.
|
||||
file, ext = os.path.splitext(filename)
|
||||
response = sendfile(request, filename, attachment=True, attachment_filename="%s.%s" % (mix.title, ext))
|
||||
filename = "%s/mixes/%s.mp3" % (here(settings.MEDIA_ROOT), mix.uid)
|
||||
response = sendfile(request, filename, attachment=True, attachment_filename="Deep South Sounds - %s.mp3" % mix.title)
|
||||
return response
|
||||
except Exception, ex:
|
||||
print ex
|
||||
|
||||
@@ -119,9 +119,9 @@ define ['moment', 'app', 'vent', 'marionette', 'utils', 'models/comment/commentC
|
||||
true
|
||||
|
||||
mixDownload: ->
|
||||
console.log("MixItemView: mixDownload")
|
||||
utils.downloadURL("/audio/download/" + @model.get('id'))
|
||||
true
|
||||
|
||||
return false;
|
||||
|
||||
MixItemView
|
||||
|
||||
@@ -156,7 +156,11 @@
|
||||
return true;
|
||||
};
|
||||
|
||||
MixItemView.prototype.mixDownload = function() {};
|
||||
MixItemView.prototype.mixDownload = function() {
|
||||
console.log("MixItemView: mixDownload");
|
||||
utils.downloadURL("/audio/download/" + this.model.get('id'));
|
||||
return true;
|
||||
};
|
||||
|
||||
return MixItemView;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user