summary refs log tree commit diff
path: root/synapse/storage/media_repository.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-04 14:22:31 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-04 14:22:31 +0000
commitc01fd5573c92c7c6da258bac7ff377a91cbebfd1 (patch)
tree7562ac0c1e8b8ac8821c3255cbdbcc8d3fc15031 /synapse/storage/media_repository.py
parentFix pyflakes and pep8 warnings (diff)
downloadsynapse-c01fd5573c92c7c6da258bac7ff377a91cbebfd1.tar.xz
Implement download support for media_repository
Diffstat (limited to 'synapse/storage/media_repository.py')
-rw-r--r--synapse/storage/media_repository.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/synapse/storage/media_repository.py b/synapse/storage/media_repository.py
index eda191ad5b..2d3a2d1ccb 100644
--- a/synapse/storage/media_repository.py
+++ b/synapse/storage/media_repository.py
@@ -22,13 +22,13 @@ class MediaRepositoryStore(SQLBaseStore):
     def get_local_media(self, media_id):
         """Get the metadata for a local piece of media
         Returns:
-            None if the media_id doesn't exist.
+            None if the meia_id doesn't exist.
         """
         return self._simple_select_one(
             "local_media_repository",
             {"media_id": media_id},
             ("media_type", "media_length", "upload_name", "created_ts"),
-            True,
+            allow_none=True,
         )
 
     def store_local_media(self, media_id, media_type, time_now_ms, upload_name,
@@ -73,7 +73,11 @@ class MediaRepositoryStore(SQLBaseStore):
         return self._simple_select_one(
             "remote_media_cache",
             {"media_origin": origin, "media_id": media_id},
-            ("media_type", "media_length", "upload_name", "created_ts"),
+            (
+                "media_type", "media_length", "upload_name", "created_ts",
+                "filesystem_id",
+            ),
+            allow_none=True,
         )
 
     def store_cached_remote_media(self, origin, media_id, media_type,