diff sat/plugins/plugin_comp_file_sharing_management.py @ 3288:780fb8dd07ef

core (memory/sqlite): new database schema (v9): this new schema brings the new `public_id` column, which will be used to serve files via HTTP, splits `mime_type` in 2 (`media_type` and `media_subtype`) to make indexing/media filtering easier, and fixes indexes for `files` table.
author Goffi <goffi@goffi.org>
date Fri, 29 May 2020 21:50:49 +0200
parents 559a625a236b
children d0e8b0a3ef9c
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing_management.py	Fri May 29 21:07:10 2020 +0200
+++ b/sat/plugins/plugin_comp_file_sharing_management.py	Fri May 29 21:50:49 2020 +0200
@@ -381,9 +381,9 @@
                 yield self._genThumbs(client, requestor, namespace, sub_file_data)
 
         elif file_data['type'] == C.FILE_TYPE_FILE:
-            mime_type = file_data['mime_type']
+            media_type = file_data['media_type']
             file_path = os.path.join(self.files_path, file_data['file_hash'])
-            if mime_type is not None and mime_type.startswith("image"):
+            if media_type == 'image':
                 thumbnails = []
 
                 for max_thumb_size in (self._t.SIZE_SMALL, self._t.SIZE_MEDIUM):