added frontend for social + feed partiali working

This commit is contained in:
2026-05-18 02:25:47 +02:00
parent e1df55df0e
commit 202ce22102
88 changed files with 4236 additions and 737 deletions

View File

@@ -67,7 +67,18 @@ class PostContent(SoftDeleteModel):
def save(self, *args, **kwargs):
if self.file and not self.file._committed:
self.mime_type = mime.from_buffer(self.file.read(1024))
if mime is not None:
data = self.file.read(1024)
self.file.seek(0)
self.mime_type = mime.from_buffer(data)
else:
import mimetypes
content_type = getattr(self.file, 'content_type', None)
self.mime_type = (
content_type
or mimetypes.guess_type(self.file.name)[0]
or 'application/octet-stream'
)
return super().save(*args, **kwargs)