mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-08 04:54:57 -04:00
Get the code actually working
This commit is contained in:
parent
cc84d3ea78
commit
e5275d856e
6 changed files with 61 additions and 52 deletions
|
@ -23,9 +23,7 @@ from synapse.api.errors import (
|
|||
from twisted.web.server import NOT_DONE_YET
|
||||
from twisted.internet import defer
|
||||
|
||||
from .baseresource import BaseMediaResource
|
||||
|
||||
import os
|
||||
from .base_resource import BaseMediaResource
|
||||
|
||||
import logging
|
||||
|
||||
|
@ -75,7 +73,7 @@ class UploadResource(BaseMediaResource):
|
|||
media_id = random_string(24)
|
||||
|
||||
fname = self.filepaths.local_media_filepath(media_id)
|
||||
os.makedirs(os.path.dirname(fname))
|
||||
self._makedirs(fname)
|
||||
|
||||
# This shouldn't block for very long because the content will have
|
||||
# already been uploaded at this point.
|
||||
|
@ -95,7 +93,7 @@ class UploadResource(BaseMediaResource):
|
|||
"media_length": content_length,
|
||||
}
|
||||
|
||||
yield self._generate_local_thumbnails(self, media_id, media_info)
|
||||
yield self._generate_local_thumbnails(media_id, media_info)
|
||||
|
||||
respond_with_json(
|
||||
request, 200, {"content_token": media_id}, send_cors=True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue