Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
694f1c1b
Commit
694f1c1b
authored
7 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix up comments
parent
e21370ba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/rest/media/v1/_base.py
+2
-2
2 additions, 2 deletions
synapse/rest/media/v1/_base.py
synapse/rest/media/v1/media_repository.py
+14
-5
14 additions, 5 deletions
synapse/rest/media/v1/media_repository.py
with
16 additions
and
7 deletions
synapse/rest/media/v1/_base.py
+
2
−
2
View file @
694f1c1b
...
...
@@ -136,8 +136,8 @@ def respond_with_responder(request, responder, media_type, file_size, upload_nam
request (twisted.web.http.Request)
responder (Responder|None)
media_type (str): The media/content type.
file_size (int): Size in bytes of the media. If not known it should be None
upload_name (str): The name of the requested file, if any.
file_size (int
|None
): Size in bytes of the media. If not known it should be None
upload_name (str
|None
): The name of the requested file, if any.
"""
if
not
responder
:
respond_404
(
request
)
...
...
This diff is collapsed.
Click to expand it.
synapse/rest/media/v1/media_repository.py
+
14
−
5
View file @
694f1c1b
...
...
@@ -161,11 +161,12 @@ class MediaRepository(object):
Args:
request(twisted.web.http.Request)
media_id (str)
media_id (str): The media ID of the content. (This is the same as
the file_id for local content.)
name (str|None): Optional name that, if specified, will be used as
the filename in the Content-Disposition header of the response.
Ret
r
uns:
Retu
r
ns:
Deferred: Resolves once a response has successfully been written
to request
"""
...
...
@@ -196,11 +197,12 @@ class MediaRepository(object):
Args:
request(twisted.web.http.Request)
server_name (str): Remote server_name where the media originated.
media_id (str)
media_id (str): The media ID of the content (as defined by the
remote server).
name (str|None): Optional name that, if specified, will be used as
the filename in the Content-Disposition header of the response.
Ret
r
uns:
Retu
r
ns:
Deferred: Resolves once a response has successfully been written
to request
"""
...
...
@@ -230,6 +232,11 @@ class MediaRepository(object):
"""
Looks for media in local cache, if not there then attempt to
download from remote server.
Args:
server_name (str): Remote server_name where the media originated.
media_id (str): The media ID of the content (as defined by the
remote server).
Returns:
Deferred[(Responder, media_info)]
"""
...
...
@@ -272,7 +279,9 @@ class MediaRepository(object):
Args:
server_name (str): Originating server
media_id (str)
media_id (str): The media ID of the content (as defined by the
remote server). This is different than the file_id, which is
locally generated.
file_id (str): Local file ID
Returns:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment