From 5e81131ecf4e0b67fef09589d9610743da6e7319 Mon Sep 17 00:00:00 2001 From: Alexander Manning Date: Fri, 14 May 2021 16:35:20 +0100 Subject: [PATCH] Remove return from MediaInfo.to_thumbnail() and from MediaInfo.to_content() --- pantalaimon/daemon.py | 12 ++++++------ pantalaimon/store.py | 4 ---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pantalaimon/daemon.py b/pantalaimon/daemon.py index 1d0afe4..9693c9c 100755 --- a/pantalaimon/daemon.py +++ b/pantalaimon/daemon.py @@ -953,21 +953,21 @@ class ProxyDaemon: body=await response.transport_response.read(), ) - media_content = media_info.to_content(content, upload_info.mimetype) - if media_content["info"].get("thumbnail_url", False): + media_info.to_content(content, upload_info.mimetype) + if content["info"].get("thumbnail_url", False): ( thumb_upload_info, thumb_media_info, ) = self._get_upload_and_media_info( - "thumbnail_url", media_content["info"] + "thumbnail_url", content["info"] ) if thumb_upload_info and thumb_media_info: - media_content = thumb_media_info.to_thumbnail( - media_content, thumb_upload_info.mimetype + thumb_media_info.to_thumbnail( + content, thumb_upload_info.mimetype ) response = await client.room_send( - room_id, msgtype, media_content, txnid, ignore_unverified + room_id, msgtype, content, txnid, ignore_unverified ) else: response = await client.room_send( diff --git a/pantalaimon/store.py b/pantalaimon/store.py index 135936f..3e647f6 100644 --- a/pantalaimon/store.py +++ b/pantalaimon/store.py @@ -58,7 +58,6 @@ class MediaInfo: "mimetype": mime_type, } - return content def to_thumbnail(self, content: Dict, mime_type: str) -> Dict[Any, Any]: content["info"]["thumbnail_file"] = { @@ -70,9 +69,6 @@ class MediaInfo: "mimetype": mime_type, } - return content - - @attr.s class UploadInfo: