This repository has been archived by the owner on May 14, 2024. It is now read-only.
don't use file extension to check if file need conversion #677
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
we added a check based on the file extension to check if the file is heic so that we can store the file without the
converted
in the cache if it doesn't need conversion and will be the original file and hence redownload won't need us to download the original file again.This broke for the current case where the file extension was jpg, which resulted in us not converting the file. but the file was actually heic.
Also, there are more cases we need to handle if we want to avoid redownloading files (like if we have the original file, and want the converted file then we can avoid downloading the file as that file can be converted) but the benefits don't seem that attractive compared to the code complexity it will cause.
so removing that logic. Now if we get a file for preview, we save it as
file_id
_preview key and if we get it for download, we save it withfile_id
keyand the check for the required key is not present, we redownload and don't do any smart logic.
Can do it later when doing performance improvements
Test Plan
tested locally for both
web.ente.io
andalbum.ente.io