diff --git a/app/services/cache_service.py b/app/services/cache_service.py index 2535dcd..4e62823 100644 --- a/app/services/cache_service.py +++ b/app/services/cache_service.py @@ -463,16 +463,19 @@ class CacheService: tmp.write(content) tmp_path = Path(tmp.name) + # Detect MIME type before moving file + mime_type = get_mime_type(tmp_path) + # Store in cache cached, ipfs_cid = self.cache.put(tmp_path, node_type="upload", move=True) content_hash = cached.content_hash - # Save to database + # Save to database with detected MIME type await self.db.create_cache_item(content_hash, ipfs_cid) await self.db.save_item_metadata( content_hash=content_hash, actor_id=actor_id, - item_type="media", + item_type=mime_type, # Store actual MIME type filename=filename )