summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-10 15:46:18 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-10 15:46:18 +0000
commite5275d856ee7a1d7aeccd3ea6ab97b49456d24c9 (patch)
tree80ad9c576d4f11988ff674d45ed17a7c2cd9fda8 /synapse/storage
parentThumbnail uploaded and cached images (diff)
downloadsynapse-e5275d856ee7a1d7aeccd3ea6ab97b49456d24c9.tar.xz
Get the code actually working
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/media_repository.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/storage/media_repository.py b/synapse/storage/media_repository.py
index a848662716..18c068d3d9 100644
--- a/synapse/storage/media_repository.py
+++ b/synapse/storage/media_repository.py
@@ -19,6 +19,9 @@ from _base import SQLBaseStore
 class MediaRepositoryStore(SQLBaseStore):
     """Persistence for attachments and avatars"""
 
+    def get_default_thumbnails(self, top_level_type, sub_type):
+        return []
+
     def get_local_media(self, media_id):
         """Get the metadata for a local piece of media
         Returns:
@@ -47,7 +50,7 @@ class MediaRepositoryStore(SQLBaseStore):
 
     def get_local_media_thumbnails(self, media_id):
         return self._simple_select_list(
-            "local_media_thumbnails",
+            "local_media_repository_thumbnails",
             {"media_id": media_id},
             (
                 "thumbnail_width", "thumbnail_height", "thumbnail_method",
@@ -59,7 +62,7 @@ class MediaRepositoryStore(SQLBaseStore):
                               thumbnail_height, thumbnail_type,
                               thumbnail_method, thumbnail_length):
         return self._simple_insert(
-            "local_media_thumbnails",
+            "local_media_repository_thumbnails",
             {
                 "media_id": media_id,
                 "thumbnail_width": thumbnail_width,
@@ -100,11 +103,10 @@ class MediaRepositoryStore(SQLBaseStore):
     def get_remote_media_thumbnails(self, origin, media_id):
         return self._simple_select_list(
             "remote_media_cache_thumbnails",
-            {"origin": origin, "media_id": media_id},
+            {"media_origin": origin, "media_id": media_id},
             (
-                "thumbnail_width", "thumbnail_height", "thumbnail_method"
-                "thumbnail_type", "thumbnail_length",
-                "filesystem_id"
+                "thumbnail_width", "thumbnail_height", "thumbnail_method",
+                "thumbnail_type", "thumbnail_length", "filesystem_id",
             )
         )