mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-22 12:00:41 -04:00
parent
4504151546
commit
46f4be94b4
6 changed files with 429 additions and 69 deletions
|
@ -452,6 +452,33 @@ class MediaRepositoryStore(MediaRepositoryBackgroundUpdateStore):
|
|||
desc="get_remote_media_thumbnails",
|
||||
)
|
||||
|
||||
async def get_remote_media_thumbnail(
|
||||
self, origin: str, media_id: str, t_width: int, t_height: int, t_type: str,
|
||||
) -> Optional[Dict[str, Any]]:
|
||||
"""Fetch the thumbnail info of given width, height and type.
|
||||
"""
|
||||
|
||||
return await self.db_pool.simple_select_one(
|
||||
table="remote_media_cache_thumbnails",
|
||||
keyvalues={
|
||||
"media_origin": origin,
|
||||
"media_id": media_id,
|
||||
"thumbnail_width": t_width,
|
||||
"thumbnail_height": t_height,
|
||||
"thumbnail_type": t_type,
|
||||
},
|
||||
retcols=(
|
||||
"thumbnail_width",
|
||||
"thumbnail_height",
|
||||
"thumbnail_method",
|
||||
"thumbnail_type",
|
||||
"thumbnail_length",
|
||||
"filesystem_id",
|
||||
),
|
||||
allow_none=True,
|
||||
desc="get_remote_media_thumbnail",
|
||||
)
|
||||
|
||||
async def store_remote_media_thumbnail(
|
||||
self,
|
||||
origin,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue