summary refs log tree commit diff
path: root/synapse/rest/media/v1/filepath.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-12-31 13:40:07 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-12-31 13:40:07 +0000
commit47c25048c551570c97fa71db60c41d3dffa23773 (patch)
tree0ab55796a669536f110b3d2ee022ae73c3f2c13f /synapse/rest/media/v1/filepath.py
parentMerge commit 'fedfdfd75' into anoa/dinsic_release_1_23_1 (diff)
parentMerge branch 'master' into develop (diff)
downloadsynapse-47c25048c551570c97fa71db60c41d3dffa23773.tar.xz
Merge commit '24229fac0' into anoa/dinsic_release_1_23_1
Diffstat (limited to 'synapse/rest/media/v1/filepath.py')
-rw-r--r--synapse/rest/media/v1/filepath.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/filepath.py b/synapse/rest/media/v1/filepath.py

index 7447eeaebe..9e079f672f 100644 --- a/synapse/rest/media/v1/filepath.py +++ b/synapse/rest/media/v1/filepath.py
@@ -69,6 +69,23 @@ class MediaFilePaths: local_media_thumbnail = _wrap_in_base_path(local_media_thumbnail_rel) + def local_media_thumbnail_dir(self, media_id: str) -> str: + """ + Retrieve the local store path of thumbnails of a given media_id + + Args: + media_id: The media ID to query. + Returns: + Path of local_thumbnails from media_id + """ + return os.path.join( + self.base_path, + "local_thumbnails", + media_id[0:2], + media_id[2:4], + media_id[4:], + ) + def remote_media_filepath_rel(self, server_name, file_id): return os.path.join( "remote_content", server_name, file_id[0:2], file_id[2:4], file_id[4:]