diff options
author | Erik Johnston <erik@matrix.org> | 2020-01-20 17:38:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 17:38:21 +0000 |
commit | b0a66ab83ce4d67e145a1129b1ebd8fc53c24408 (patch) | |
tree | e92fe5cc41128b369e096f2e34c7bae0e369803e /synapse/rest/media/v1/thumbnail_resource.py | |
parent | Fix `/events/:event_id` deprecated API. (#6731) (diff) | |
download | synapse-b0a66ab83ce4d67e145a1129b1ebd8fc53c24408.tar.xz |
Fixup synapse.rest to pass mypy (#6732)
Diffstat (limited to 'synapse/rest/media/v1/thumbnail_resource.py')
-rw-r--r-- | synapse/rest/media/v1/thumbnail_resource.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/rest/media/v1/thumbnail_resource.py b/synapse/rest/media/v1/thumbnail_resource.py index 931ce79be8..eee93b4313 100644 --- a/synapse/rest/media/v1/thumbnail_resource.py +++ b/synapse/rest/media/v1/thumbnail_resource.py @@ -296,8 +296,8 @@ class ThumbnailResource(DirectServeResource): d_h = desired_height if desired_method.lower() == "crop": - info_list = [] - info_list2 = [] + crop_info_list = [] + crop_info_list2 = [] for info in thumbnail_infos: t_w = info["thumbnail_width"] t_h = info["thumbnail_height"] @@ -309,7 +309,7 @@ class ThumbnailResource(DirectServeResource): type_quality = desired_type != info["thumbnail_type"] length_quality = info["thumbnail_length"] if t_w >= d_w or t_h >= d_h: - info_list.append( + crop_info_list.append( ( aspect_quality, min_quality, @@ -320,7 +320,7 @@ class ThumbnailResource(DirectServeResource): ) ) else: - info_list2.append( + crop_info_list2.append( ( aspect_quality, min_quality, @@ -330,10 +330,10 @@ class ThumbnailResource(DirectServeResource): info, ) ) - if info_list: - return min(info_list)[-1] + if crop_info_list: + return min(crop_info_list2)[-1] else: - return min(info_list2)[-1] + return min(crop_info_list2)[-1] else: info_list = [] info_list2 = [] |