summary refs log tree commit diff
path: root/synapse/rest/media/v1/thumbnail_resource.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/rest/media/v1/thumbnail_resource.py')
-rw-r--r--synapse/rest/media/v1/thumbnail_resource.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/synapse/rest/media/v1/thumbnail_resource.py b/synapse/rest/media/v1/thumbnail_resource.py
index e20d6f10b0..1451f6f106 100644
--- a/synapse/rest/media/v1/thumbnail_resource.py
+++ b/synapse/rest/media/v1/thumbnail_resource.py
@@ -85,7 +85,9 @@ class ThumbnailResource(Resource):
         media_info = yield self.store.get_local_media(media_id)
 
         if not media_info or media_info["quarantined_by"]:
-            logger.info("Media is quarantined")
+            if media_info:
+                logger.info("Media is quarantined")
+
             respond_404(request)
             return
 
@@ -122,7 +124,8 @@ class ThumbnailResource(Resource):
         media_info = yield self.store.get_local_media(media_id)
 
         if not media_info or media_info["quarantined_by"]:
-            logger.info("Media is quarantined")
+            if media_info["quarantined_by"]:
+                logger.info("Media is quarantined")
             respond_404(request)
             return
 
@@ -152,7 +155,7 @@ class ThumbnailResource(Resource):
                     yield respond_with_responder(request, responder, t_type, t_length)
                     return
 
-        logger.debug("We don't have a local thumbnail of that size. Generating")
+        logger.debug("We don't have a thumbnail of that size. Generating")
 
         # Okay, so we generate one.
         file_path = yield self.media_repo.generate_local_exact_thumbnail(
@@ -162,7 +165,7 @@ class ThumbnailResource(Resource):
         if file_path:
             yield respond_with_file(request, desired_type, file_path)
         else:
-            logger.warn("Failed to generate local thumbnail")
+            logger.warn("Failed to generate thumbnail")
             respond_404(request)
 
     @defer.inlineCallbacks
@@ -201,7 +204,7 @@ class ThumbnailResource(Resource):
                     yield respond_with_responder(request, responder, t_type, t_length)
                     return
 
-        logger.debug("We don't have a remote thumbnail of that size. Generating")
+        logger.debug("We don't have a thumbnail of that size. Generating")
 
         # Okay, so we generate one.
         file_path = yield self.media_repo.generate_remote_exact_thumbnail(
@@ -212,7 +215,7 @@ class ThumbnailResource(Resource):
         if file_path:
             yield respond_with_file(request, desired_type, file_path)
         else:
-            logger.warn("Failed to generate remote thumbnail")
+            logger.warn("Failed to generate thumbnail")
             respond_404(request)
 
     @defer.inlineCallbacks