mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-28 15:10:16 -05:00
Use inline type hints in handlers/ and rest/. (#10382)
This commit is contained in:
parent
36dc15412d
commit
98aec1cc9d
43 changed files with 212 additions and 215 deletions
|
|
@ -78,16 +78,16 @@ class MediaRepository:
|
|||
|
||||
Thumbnailer.set_limits(self.max_image_pixels)
|
||||
|
||||
self.primary_base_path = hs.config.media_store_path # type: str
|
||||
self.filepaths = MediaFilePaths(self.primary_base_path) # type: MediaFilePaths
|
||||
self.primary_base_path: str = hs.config.media_store_path
|
||||
self.filepaths: MediaFilePaths = MediaFilePaths(self.primary_base_path)
|
||||
|
||||
self.dynamic_thumbnails = hs.config.dynamic_thumbnails
|
||||
self.thumbnail_requirements = hs.config.thumbnail_requirements
|
||||
|
||||
self.remote_media_linearizer = Linearizer(name="media_remote")
|
||||
|
||||
self.recently_accessed_remotes = set() # type: Set[Tuple[str, str]]
|
||||
self.recently_accessed_locals = set() # type: Set[str]
|
||||
self.recently_accessed_remotes: Set[Tuple[str, str]] = set()
|
||||
self.recently_accessed_locals: Set[str] = set()
|
||||
|
||||
self.federation_domain_whitelist = hs.config.federation_domain_whitelist
|
||||
|
||||
|
|
@ -711,7 +711,7 @@ class MediaRepository:
|
|||
|
||||
# We deduplicate the thumbnail sizes by ignoring the cropped versions if
|
||||
# they have the same dimensions of a scaled one.
|
||||
thumbnails = {} # type: Dict[Tuple[int, int, str], str]
|
||||
thumbnails: Dict[Tuple[int, int, str], str] = {}
|
||||
for r_width, r_height, r_method, r_type in requirements:
|
||||
if r_method == "crop":
|
||||
thumbnails.setdefault((r_width, r_height, r_type), r_method)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue