Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use the right path for url_preview thumbnails
Browse files Browse the repository at this point in the history
This was introduced by #2627: we were overwriting the original media for url
previews with the thumbnails :/

(fixes element-hq/element-web#6012, hopefully)
  • Loading branch information
richvdh authored and hera committed Jan 19, 2018
1 parent 9249f11 commit cbdf620
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions synapse/rest/media/v1/media_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ def _file_info_to_path(self, file_info):
str
"""
if file_info.url_cache:
if file_info.thumbnail:
return self.filepaths.url_cache_thumbnail_rel(
media_id=file_info.file_id,
width=file_info.thumbnail_width,
height=file_info.thumbnail_height,
content_type=file_info.thumbnail_type,
method=file_info.thumbnail_method,
)
return self.filepaths.url_cache_filepath_rel(file_info.file_id)

if file_info.server_name:
Expand Down

0 comments on commit cbdf620

Please sign in to comment.