kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Merge branch '204-missing-dot' into 'develop'
Resolve "Missing dot in file name when downloading file" Closes #204 See merge request funkwhale/funkwhale!194merge-requests/237/head
commit
5abac103c4
|
@ -467,7 +467,7 @@ class TrackFile(models.Model):
|
|||
|
||||
@property
|
||||
def filename(self):
|
||||
return '{}{}'.format(
|
||||
return '{}.{}'.format(
|
||||
self.track.full_name,
|
||||
self.extension)
|
||||
|
||||
|
|
|
@ -275,7 +275,10 @@ def handle_serve(track_file):
|
|||
file_path = get_file_path(audio_file)
|
||||
elif f.source and f.source.startswith('file://'):
|
||||
file_path = get_file_path(f.source.replace('file://', '', 1))
|
||||
response = Response()
|
||||
if mt:
|
||||
response = Response(content_type=mt)
|
||||
else:
|
||||
response = Response()
|
||||
filename = f.filename
|
||||
mapping = {
|
||||
'nginx': 'X-Accel-Redirect',
|
||||
|
|
|
@ -77,3 +77,11 @@ def test_audio_track_mime_type(extention, mimetype, factories):
|
|||
tf = factories['music.TrackFile'](audio_file__from_path=path)
|
||||
|
||||
assert tf.mimetype == mimetype
|
||||
|
||||
|
||||
def test_track_file_file_name(factories):
|
||||
name = 'test.mp3'
|
||||
path = os.path.join(DATA_DIR, name)
|
||||
tf = factories['music.TrackFile'](audio_file__from_path=path)
|
||||
|
||||
assert tf.filename == tf.track.full_name + '.mp3'
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fixed missing dot when downloading file (#204)
|
Ładowanie…
Reference in New Issue