Skip to content
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

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

abhinavkgrd
Copy link
Member

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 with file_id key

and 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 and album.ente.io

@vishnukvmd vishnukvmd merged commit 6f6b340 into main Aug 1, 2022
@vishnukvmd vishnukvmd deleted the heic-preview-issue branch August 1, 2022 11:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants