mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 16:54:56 -04:00
Store URL cache preview downloads seperately
This makes it easier to clear old media out at a later date
This commit is contained in:
parent
e204062310
commit
7fe8ed1787
7 changed files with 94 additions and 20 deletions
|
@ -73,7 +73,12 @@ class DownloadResource(Resource):
|
|||
media_type = media_info["media_type"]
|
||||
media_length = media_info["media_length"]
|
||||
upload_name = name if name else media_info["upload_name"]
|
||||
file_path = self.filepaths.local_media_filepath(media_id)
|
||||
if media_info["url_cache"]:
|
||||
# TODO: Check the file still exists, if it doesn't we can redownload
|
||||
# it from the url `media_info["url_cache"]`
|
||||
file_path = self.filepaths.url_cache_filepath(media_id)
|
||||
else:
|
||||
file_path = self.filepaths.local_media_filepath(media_id)
|
||||
|
||||
yield respond_with_file(
|
||||
request, media_type, file_path, media_length,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue