mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-17 23:42:33 +01:00
Remove dead code from MediaFilePaths
(#11056)
This commit is contained in:
parent
b3e9b00fb2
commit
b59f3281d5
2 changed files with 1 additions and 17 deletions
1
changelog.d/11056.misc
Normal file
1
changelog.d/11056.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Remove dead code from `MediaFilePaths`.
|
|
@ -48,23 +48,6 @@ class MediaFilePaths:
|
||||||
def __init__(self, primary_base_path: str):
|
def __init__(self, primary_base_path: str):
|
||||||
self.base_path = primary_base_path
|
self.base_path = primary_base_path
|
||||||
|
|
||||||
def default_thumbnail_rel(
|
|
||||||
self,
|
|
||||||
default_top_level: str,
|
|
||||||
default_sub_type: str,
|
|
||||||
width: int,
|
|
||||||
height: int,
|
|
||||||
content_type: str,
|
|
||||||
method: str,
|
|
||||||
) -> str:
|
|
||||||
top_level_type, sub_type = content_type.split("/")
|
|
||||||
file_name = "%i-%i-%s-%s-%s" % (width, height, top_level_type, sub_type, method)
|
|
||||||
return os.path.join(
|
|
||||||
"default_thumbnails", default_top_level, default_sub_type, file_name
|
|
||||||
)
|
|
||||||
|
|
||||||
default_thumbnail = _wrap_in_base_path(default_thumbnail_rel)
|
|
||||||
|
|
||||||
def local_media_filepath_rel(self, media_id: str) -> str:
|
def local_media_filepath_rel(self, media_id: str) -> str:
|
||||||
return os.path.join("local_content", media_id[0:2], media_id[2:4], media_id[4:])
|
return os.path.join("local_content", media_id[0:2], media_id[2:4], media_id[4:])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue