Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add media auto-download #5076

Merged
merged 78 commits into from
Aug 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
fb664a1
feat: media auto-download view
reinaldonetof May 9, 2023
ab56ecd
media auto download view completed and saving the settings in mmkv
reinaldonetof May 9, 2023
871dc7f
audio download preference
reinaldonetof May 11, 2023
f5d6fce
Merge branch 'develop' into feat.media-auto-download-preference
reinaldonetof May 11, 2023
b73cf46
audio auto download when the user who sent the audio is the same logg…
reinaldonetof May 11, 2023
7fc975f
creation of isAutoDownloadEnabled, evaluate hist hook, Image Full Siz…
reinaldonetof May 11, 2023
d138a74
minor tweak audio show play button after download
reinaldonetof May 12, 2023
27eacaa
refactor audioFile to handleMediaDownload and fixed the audio download
reinaldonetof May 15, 2023
07e0970
desestructured params to download too
reinaldonetof May 15, 2023
cdad288
image download and autoDownload, algo fix the formatAttachmentUrl to …
reinaldonetof May 15, 2023
991cdf1
add the possibility to cancel image download and clear local images
reinaldonetof May 15, 2023
389057a
refactor blur component
reinaldonetof May 15, 2023
6c49c57
video download and auto download, also keeped the behavior to downloa…
reinaldonetof May 16, 2023
acb280f
add the possibility to start downloading a video, then exit the room,…
reinaldonetof May 16, 2023
7108e35
remove the custom hook for autoDownload
reinaldonetof May 16, 2023
d3c87a1
remove blurcomponent, fix the blur style in image.tsx, minor tweak vi…
reinaldonetof May 17, 2023
370f893
send messageId to video
reinaldonetof May 17, 2023
154deb6
introducing the reducer to keep the downloads in progress
reinaldonetof May 18, 2023
f136dfb
create a media download selector
reinaldonetof May 18, 2023
95cbe25
remove all the redux stuff and do the same as file upload
reinaldonetof May 19, 2023
aa2c288
video download behavior
reinaldonetof May 19, 2023
02ba6e9
done for image and audio
reinaldonetof May 19, 2023
99973c0
fix the try catch download media
reinaldonetof May 19, 2023
ce67d05
clean up
reinaldonetof May 19, 2023
41bce65
image container uiKit
reinaldonetof May 19, 2023
789ee3e
Merge branch 'develop' into feat.media-auto-download-preference
reinaldonetof May 19, 2023
74e6e8f
fix lint
reinaldonetof May 19, 2023
4dcb128
change rn-fetch-blob to expo-filesystem
reinaldonetof May 19, 2023
58f73e1
add pt-br
reinaldonetof May 19, 2023
67ba313
pass the correct message id when there is an attachment on reply
reinaldonetof May 19, 2023
1dc038d
refactor some changes requested
reinaldonetof May 30, 2023
c244dd4
fix audio and move the netInfo from autoDownloadPreference to redux
reinaldonetof Jun 7, 2023
6f3dc60
variable isAutoDownloadEnable name and handleMediaDownload getExtension
reinaldonetof Jun 7, 2023
8c0c1d7
message/Image refactored, change the component to show the image from…
reinaldonetof Jun 7, 2023
989e609
refactor handleMediaDownload and deleteMedia
reinaldonetof Jun 7, 2023
420bd49
minor tweak
reinaldonetof Jun 7, 2023
b341528
refactor audio
reinaldonetof Jun 7, 2023
b4a9b8a
refactor video
reinaldonetof Jun 7, 2023
07f0fd5
fix the type on the messagesView(the view of files)
reinaldonetof Jun 7, 2023
c1fbc20
minor tweak
reinaldonetof Jun 7, 2023
e7244d9
fix the name of searchMediaFIleAsync's result
reinaldonetof Jun 7, 2023
ce48ef0
minor tweak, add the default behavior, add the OFF as label
reinaldonetof Jun 9, 2023
63b49ab
minor tweaks
reinaldonetof Jun 12, 2023
e0942b2
verify if the media auto download exists on settings view
reinaldonetof Jun 12, 2023
332e51f
fix media auto download view layout and minor tweak wifi
reinaldonetof Jun 26, 2023
469d42b
avoid auto download from reply
reinaldonetof Jun 26, 2023
2d2988a
minor tweak at comment
reinaldonetof Jun 27, 2023
e0b86c0
tweak list.section
reinaldonetof Jun 27, 2023
a92d88c
change the name to netInfoState and Local_document_directory
reinaldonetof Jun 30, 2023
1be2326
Merge branch 'develop' into feat.media-auto-download-preference
reinaldonetof Jun 30, 2023
b6ae55e
remove mediaType and refactor audio and image
reinaldonetof Jul 3, 2023
b886031
separate blurview
reinaldonetof Jul 3, 2023
d39a5c7
thumbnail video and video behavior
reinaldonetof Jul 4, 2023
53ed61d
add Audio to i18n and minor tweak
reinaldonetof Jul 4, 2023
c85f989
set the blur as always dark and add the possibility to overlay
reinaldonetof Jul 4, 2023
b3f4605
don't need to controle the filepath in the view
reinaldonetof Jul 4, 2023
b6dceec
fix the loading in image and video at begin
reinaldonetof Jul 4, 2023
3072196
save the file with a similar filename as expected
reinaldonetof Jul 4, 2023
fb7da4f
removed the necessity of messageId or id
reinaldonetof Jul 4, 2023
f5c3c7a
minor tweak
reinaldonetof Jul 4, 2023
edd4fb6
switch useLayoutEffect to useEffect
reinaldonetof Jul 5, 2023
42507b6
avoid onpress do some edge case because of cached at video
reinaldonetof Jul 5, 2023
6ed1c7e
minor tweak
reinaldonetof Jul 5, 2023
abb7df7
tweak at audio comment extension
reinaldonetof Jul 5, 2023
8ed68ef
minor tweak type userpreferences
reinaldonetof Jul 5, 2023
5b57b35
remove test id from mediaAutoDownloadView
reinaldonetof Jul 5, 2023
65346b0
Merge branch 'develop' into feat.media-auto-download-preference
reinaldonetof Jul 20, 2023
c1b16d0
change action's name to SET_NET_INFO_STATE
reinaldonetof Jul 20, 2023
71ec969
caching and deleting video's thumbnails
reinaldonetof Jul 20, 2023
7e81d41
remove generate thumbnail
reinaldonetof Jul 24, 2023
3e75699
minor tweak in image
reinaldonetof Jul 24, 2023
3ada875
update camera-roll and save the file from local url
reinaldonetof Jul 25, 2023
fb576ef
remove local_cache_directory and deleteThumbnail
reinaldonetof Jul 25, 2023
892e7ba
update blur to fix error on android
reinaldonetof Jul 25, 2023
731f3f2
fix blur is hiding the file description
reinaldonetof Aug 2, 2023
845c5f0
avoid download unsupported video
reinaldonetof Aug 3, 2023
d3dfc48
return void when it is loading the audio
reinaldonetof Aug 3, 2023
34cf388
Merge branch 'develop' into feat.media-auto-download-preference
reinaldonetof Aug 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor tweak in image
reinaldonetof committed Jul 24, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 3e75699b0bbcb70cbca9d7166573890bbbda4173
4 changes: 2 additions & 2 deletions app/containers/message/Image.tsx
Original file line number Diff line number Diff line change
@@ -98,6 +98,7 @@ const ImageContainer = React.memo(
if (isDownloadActive(imgUrlToCache)) {
return;
}
setLoading(false);
await handleAutoDownload();
}
};
@@ -113,13 +114,12 @@ const ImageContainer = React.memo(
const isAutoDownloadEnabled = fetchAutoDownloadEnabled('imagesPreferenceDownload');
if (isAutoDownloadEnabled || isCurrentUserAuthor) {
await handleDownload();
return;
}
setLoading(false);
};

const handleDownload = async () => {
try {
setLoading(true);
const imageUri = await downloadMediaFile({
downloadUrl: imgUrlToCache,
type: 'image',