Merge branch 'master' into develop

This commit is contained in:
Eliot Berriot 2019-10-17 15:22:32 +02:00
commit c58c74d653
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
14 changed files with 73 additions and 8 deletions

View file

@ -72,7 +72,7 @@ def clean_id3_pictures(apic):
def get_mp4_tag(f, k):
if k == "pictures":
return f.get("covr")
return f.get("covr", [])
raw_value = f.get(k, None)
if not raw_value:

View file

@ -320,6 +320,10 @@ def get_file_path(audio_file):
)
path = "/music" + audio_file.replace(prefix, "", 1)
if path.startswith("http://") or path.startswith("https://"):
protocol, remainder = path.split("://", 1)
hostname, r_path = remainder.split("/", 1)
r_path = urllib.parse.quote(r_path)
path = protocol + "://" + hostname + "/" + r_path
return (settings.PROTECT_FILES_PATH + "/media/" + path).encode("utf-8")
# needed to serve files with % or ? chars
path = urllib.parse.quote(path)