comparison 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
comparison
equal deleted inserted replaced
3287:a4b8c9bcfb57 3288:780fb8dd07ef
379 client, requestor, parent=file_data['id'], namespace=namespace) 379 client, requestor, parent=file_data['id'], namespace=namespace)
380 for sub_file_data in sub_files_data: 380 for sub_file_data in sub_files_data:
381 yield self._genThumbs(client, requestor, namespace, sub_file_data) 381 yield self._genThumbs(client, requestor, namespace, sub_file_data)
382 382
383 elif file_data['type'] == C.FILE_TYPE_FILE: 383 elif file_data['type'] == C.FILE_TYPE_FILE:
384 mime_type = file_data['mime_type'] 384 media_type = file_data['media_type']
385 file_path = os.path.join(self.files_path, file_data['file_hash']) 385 file_path = os.path.join(self.files_path, file_data['file_hash'])
386 if mime_type is not None and mime_type.startswith("image"): 386 if media_type == 'image':
387 thumbnails = [] 387 thumbnails = []
388 388
389 for max_thumb_size in (self._t.SIZE_SMALL, self._t.SIZE_MEDIUM): 389 for max_thumb_size in (self._t.SIZE_SMALL, self._t.SIZE_MEDIUM):
390 try: 390 try:
391 thumb_size, thumb_id = yield self._t.generateThumbnail( 391 thumb_size, thumb_id = yield self._t.generateThumbnail(