little cleaning

This commit is contained in:
Andrea Spacca 2020-12-22 17:45:34 +01:00
parent 8a40b9e6bc
commit a533c25efd

View File

@ -846,7 +846,7 @@ class ProxyDaemon:
self.store.save_media(self.name, media)
try:
response, decrypted_file, error = await self._load_media(mxc_server, mxc_path, file_name, request)
response, decrypted_file = await self._load_media(mxc_server, mxc_path, file_name, request)
if response is None and decrypted_file is None:
return await self.forward_to_web(request, token=client.access_token)
@ -865,10 +865,10 @@ class ProxyDaemon:
encrypt=False,
)
if not isinstance(decrypted_upload[0], UploadResponse):
if not isinstance(decrypted_upload, UploadResponse):
raise ValueError
content["url"] = decrypted_upload[0].content_uri
content["url"] = decrypted_upload.content_uri
return content
@ -1182,7 +1182,7 @@ class ProxyDaemon:
file_name = request.match_info.get("file_name")
try:
response, decrypted_file, error = await self._load_media(server_name, media_id, file_name, request)
response, decrypted_file = await self._load_media(server_name, media_id, file_name, request)
if response is None and decrypted_file is None:
return await self.forward_to_web(request)