From 023c6f6f5e1355977d441c8c2cce68044dee6e91 Mon Sep 17 00:00:00 2001 From: David Magnus Henriques Date: Thu, 10 May 2018 13:24:26 +0200 Subject: [PATCH] Encode the Filepath utf-8 The filepath of a track gets broken when it contains special UTF-8-characters. Encoding it UTF-8 fixes this behaviour. --- api/funkwhale_api/music/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/funkwhale_api/music/views.py b/api/funkwhale_api/music/views.py index 98274e741..14900ca98 100644 --- a/api/funkwhale_api/music/views.py +++ b/api/funkwhale_api/music/views.py @@ -230,7 +230,7 @@ def get_file_path(audio_file): 'MUSIC_DIRECTORY_PATH to serve in-place imported files' ) path = '/music' + audio_file.replace(prefix, '', 1) - return settings.PROTECT_FILES_PATH + path + return (settings.PROTECT_FILES_PATH + path).encode('utf-8') if t == 'apache2': try: path = audio_file.path