Tweak media proxying

This commit is contained in:
Thomas Sileo
2019-08-18 11:59:02 +02:00
parent 8613cc0206
commit 15ad5b08c4
2 changed files with 5 additions and 4 deletions

View File

@@ -248,11 +248,11 @@ def _get_file_url(url, size, kind) -> str:
_FILE_URL_CACHE[k] = out
return out
# MEDIA_CACHE.cache(url, kind)
_logger.error(f"cache not available for {url}/{size}/{kind}")
if url.startswith(BASE_URL):
return url
return f"/p/{url}"
p = urlparse(url)
return f"/p/{p.scheme}" + p._replace(scheme="").geturl()[1:]
@filters.app_template_filter()