mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-18 22:52:07 -05:00
Get uploads working with new media repo
This commit is contained in:
parent
279c48c8b4
commit
5da65085d1
14 changed files with 56 additions and 29 deletions
|
|
@ -20,10 +20,15 @@ class MediaRepositoryStore(SQLBaseStore):
|
|||
"""Persistence for attachments and avatars"""
|
||||
|
||||
def get_local_media(self, media_id):
|
||||
"""Get the metadata for a local piece of media
|
||||
Returns:
|
||||
None if the media_id doesn't exist.
|
||||
"""
|
||||
return self._simple_select_one(
|
||||
"local_media_repository",
|
||||
{"media_id": media_id},
|
||||
("media_type", "media_length", "upload_name", "created_ts"),
|
||||
True,
|
||||
)
|
||||
|
||||
def store_local_media(self, media_id, media_type, time_now_ms, upload_name,
|
||||
|
|
@ -36,7 +41,7 @@ class MediaRepositoryStore(SQLBaseStore):
|
|||
"created_ts": time_now_ms,
|
||||
"upload_name": upload_name,
|
||||
"media_length": media_length,
|
||||
"user_id": user_id,
|
||||
"user_id": user_id.to_string(),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue