mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 13:44:58 -04:00
Move setting of file_id up to caller
This commit is contained in:
parent
5dfc83704b
commit
0a90d9ede4
2 changed files with 14 additions and 13 deletions
|
@ -185,8 +185,9 @@ class PreviewUrlResource(Resource):
|
|||
logger.debug("got media_info of '%s'" % media_info)
|
||||
|
||||
if _is_media(media_info['media_type']):
|
||||
file_id = media_info['filesystem_id']
|
||||
dims = yield self.media_repo._generate_thumbnails(
|
||||
None, media_info['filesystem_id'], media_info, url_cache=True,
|
||||
None, file_id, file_id, media_info, url_cache=True,
|
||||
)
|
||||
|
||||
og = {
|
||||
|
@ -231,8 +232,9 @@ class PreviewUrlResource(Resource):
|
|||
|
||||
if _is_media(image_info['media_type']):
|
||||
# TODO: make sure we don't choke on white-on-transparent images
|
||||
file_id = image_info['filesystem_id']
|
||||
dims = yield self.media_repo._generate_thumbnails(
|
||||
None, image_info['filesystem_id'], image_info, url_cache=True,
|
||||
None, file_id, file_id, image_info, url_cache=True,
|
||||
)
|
||||
if dims:
|
||||
og["og:image:width"] = dims['width']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue