better urls by making it yourself

This commit is contained in:
2018-11-24 21:58:21 +02:00
parent 5d8afd5b4b
commit 74ee5edd7e

View File

@@ -939,20 +939,21 @@ def zip_clean():
def get_download_url(share, file, token): def get_download_url(share, file, token):
direct = get_or_none('direct_links', share, False) direct = get_or_none('direct_links', share, False)
if direct: if direct:
return request.url_root + url_for( return "/".join((
'download_direct', app.config['PUBLIC_URL'],
name = share['name'], 'direct',
token = get_direct_token(share, file), share['name'],
filename = file get_direct_token(share, file),
) path2url(file)
))
else: else:
return request.url_root + url_for( return "/".join((
'download_token', app.config['PUBLIC_URL'],
name = share['name'], 'download',
filename = file, share['name'],
token = token token,
) path2url(file)
))
if __name__ == "__main__": if __name__ == "__main__":