summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2024-06-18 11:15:50 +0100
committerErik Johnston <erik@matrix.org>2024-06-18 11:15:50 +0100
commit760e6c61e6ecbe0f16649c7656663ac6919245a5 (patch)
tree32433ea2bc950f5873e33c8d522ce14b44802fb9
parentComments (diff)
downloadsynapse-github/erikj/fixup_multipart.tar.xz
Update storage provider interface github/erikj/fixup_multipart erikj/fixup_multipart
-rw-r--r--synapse/media/media_storage.py2
-rw-r--r--synapse/media/storage_provider.py10
2 files changed, 2 insertions, 10 deletions
diff --git a/synapse/media/media_storage.py b/synapse/media/media_storage.py
index 731feedbe2..b77bfd7f3c 100644
--- a/synapse/media/media_storage.py
+++ b/synapse/media/media_storage.py
@@ -227,7 +227,7 @@ class MediaStorage:
 
         for provider in self.storage_providers:
             for path in paths:
-                res: Any = await provider.fetch(path, file_info, media_info, federation)
+                res: Any = await provider.fetch(path, file_info)
                 if res:
                     logger.debug("Streaming %s from %s", path, provider)
                     return res
diff --git a/synapse/media/storage_provider.py b/synapse/media/storage_provider.py
index a71da3587c..3a92128faf 100644
--- a/synapse/media/storage_provider.py
+++ b/synapse/media/storage_provider.py
@@ -60,8 +60,6 @@ class StorageProvider(metaclass=abc.ABCMeta):
         self,
         path: str,
         file_info: FileInfo,
-        media_info: Optional[LocalMedia] = None,
-        federation: bool = False,
     ) -> Optional[Responder]:
         """Attempt to fetch the file described by file_info and stream it
         into writer.
@@ -69,8 +67,6 @@ class StorageProvider(metaclass=abc.ABCMeta):
         Args:
             path: Relative path of file in local cache
             file_info: The metadata of the file.
-            media_info: metadata of the media item
-            federation: Whether the requested media is for a federation request
 
         Returns:
             Returns a Responder if the provider has the file, otherwise returns None.
@@ -137,8 +133,6 @@ class StorageProviderWrapper(StorageProvider):
         self,
         path: str,
         file_info: FileInfo,
-        media_info: Optional[LocalMedia] = None,
-        federation: bool = False,
     ) -> Optional[Responder]:
         if file_info.url_cache:
             # Files in the URL preview cache definitely aren't stored here,
@@ -147,9 +141,7 @@ class StorageProviderWrapper(StorageProvider):
 
         # store_file is supposed to return an Awaitable, but guard
         # against improper implementations.
-        return await maybe_awaitable(
-            self.backend.fetch(path, file_info, media_info, federation)
-        )
+        return await maybe_awaitable(self.backend.fetch(path, file_info))
 
 
 class FileStorageProviderBackend(StorageProvider):