vauvenal5 / yaga

Nextcloud Yaga - A Nextcloud first gallery app for Android.
https://vauvenal5.github.io/yaga-docs/
GNU General Public License v3.0
136 stars 9 forks source link

Do not download images by touch on it #82

Closed luckkmaxx closed 3 years ago

luckkmaxx commented 3 years ago

The best behavior for me is just like nextcloud app: tap to view images but only download to cache (cleaned when app closed?) and only download to desired folder when you choose one or a stack of images to be downloaded (synced) to device. I dont know if this is planned for future builds. Sorry.

vauvenal5 commented 3 years ago

The cash is not cleaned on app close otherwise the previews would be gone. I am not even sure if the cash is ever cleaned automatically, would need to check this. However, without implementing a dedicated clean up job the files would still be on your device for an uncertain amount of time.

Anyway this behavior is currently not planed. I can consider adding an additional option that would allow to chose the cache as target directory. However, this issue will not get a high priority. Maybe the next time I have to touch the file location handling.

luckkmaxx commented 3 years ago

Youre right, thumbnails would go away. I dont know how NC app manages this, or if it only download a heavyless version of each image. The fact is dont display a green checkbox fot that images I dont choosed to download manually, so images (or folders) I synced with NC will keep as is, unless I sync anocher image/s through Yaga. Thanks for your attention!

vauvenal5 commented 3 years ago

I am not sure I get you right. Lets break this up a little bit.

Green Mark A green mark is displayed when an images is locally available. This behavior will not change, independent of your storage directory. See, this mark is supposed to tell you that this file is currently available on your local device. And if it is saved into your cache folder it still is available on your local device and will not require the download of any additional data to display it to you.

NC Sync If you do not want the NC Files sync and the Yaga sync to interfere with each other you just have to point them to different dirs. Now this has of course the disadvantage that you might end up having images two times on your device. A more fine grained way of specifying storage locations is planed for the future but not yet in the pipeline. #83

luckkmaxx commented 3 years ago

I understood the green mark concept, I mean I dont want to download images what were not synced in NC to my device. I know they are actually stored somewhere if you tap to see, and I could choose a different folder to avoid mixing files to local NC folder, but greenmark is annoying since there are non intentional downloaded files greenmarked in the same way I download manually.

vauvenal5 commented 3 years ago

Got it! However, I am not planing on changing that behavior for the time being. Let's see if other users feel the same. I, personally, prefer to know which images are on my device available and which not.

Edit: I can consider adding an option to disable location marking entirely. This should not be to much work. But Yaga does not yet know the concept of syncing so as far as Yaga goes when you tap an image it is your full intention to download this image.

luckkmaxx commented 3 years ago

You are great! I just hope my suggestions can help to solve some common (if they are) needs to all us.

leo-recover commented 3 years ago

I agree with this issue. My use case is using this app as a replacement for google photos. So I have some photos only on the server to save space on the phone, and when I open a photo to view it, I don't want it to be downloaded again on the phone. Moreover, if I set the local root mapping to point on the camera folder, I don't want to download the photos again, because this would interfere with google photo and even nextcloud: both will take the photo as a new one, and will upload it to the server.

vauvenal5 commented 3 years ago

If the photos do exists in your locally mapped folder they are not downloaded again. Root-Mapping also allows for mapping a non-root remote folder to a local folder. In this case only files from the mapped remote path will be put into the local folder that is selected. The rest will be put into Nextcloud Yaga's app folder.

As already discussed here not downloading it entirely is only possible if Yaga is able to find the corresponding local file. If it does not exist or Yaga can not find it then it is necessary to re-download to be able to display you the image.

An idea just crossed my mind. In theory Flutter supports displaying images from remote sources. However, I have to check if Nextcloud and/or Webdav provide direct URLs that would be compatible with this kind of access. This would have a negative impact on performance, memory usage, and mobile data usage.

Anyway, as mentioned above I probably will not touch this until I am ready to start with #83.

stavros-k commented 3 years ago

I'd like to give couple ideas on this,

So if i just browse some old photos to show to a friend today, after "5" days, they will be deleted from the phone and regain the space.

scriptator commented 3 years ago

I think the ideal behavior would be to display an image preview when a file is not available locally instead of downloading the full-sized image. The benefit would be reduced data and storage usage. There should be an API for loading downsized variants of an image, as the nextcloud webapp displays them (and the nextcloud android app as well I think)

vauvenal5 commented 3 years ago

If you do not want to look at an image, why open it in the first place?

Yaga is first and foremost a gallery app. The primary idea is to be able to see an image in its full quality when you open it. If you just want to browse through your gallery then switch your Home View into grid mode and you can browse through your images without the need to download the full quality image.

And even if I would consider this, a few questions that arise immediately:

So as discussed before, I am willing to support some simple and useful cases like described in #83 once I get around to this but the general behavior that when you tap on an image it will be provided to you in its full glory is unlikely to change.

vauvenal5 commented 3 years ago

After the latest refactoring of the download operation I now have a simple way of downloading the file for display only without saving it to the phone. I will add an option for that in the settings. However, please note that the download will still be happening meaning every time you open an image it will be fetched from the server. It just won't be saved to your phone.

stavros-k commented 3 years ago

After the latest refactoring of the download operation I now have a simple way of downloading the file for display only without saving it to the phone. I will add an option for that in the settings. However, please note that the download will still be happening meaning every time you open an image it will be fetched from the server. It just won't be saved to your phone.

This should be acceptable, but i'd like to propose something extra (if it's easy to implement), add also a time setting, where it will delete downloaded folders from cache after X (user defined) time.

vauvenal5 commented 3 years ago

@stavros-k this are two different things. In the above proposed solution nothing gets saved into the cache. For a solution where the file can be temporarily saved to the cache #83 is required.

vauvenal5 commented 3 years ago

This is now implemented in v0.24.0.

I would appreciate it if somebody could contribute documentation for this feature here: https://github.com/vauvenal5/yaga-docs

vauvenal5 commented 3 years ago

Closing this as fixed, more extensive support will be added in #83.

Just re-open if needed.

DecaTec commented 3 years ago

I would appreciate it if somebody could contribute documentation for this feature here: https://github.com/vauvenal5/yaga-docs

Here's a PR: https://github.com/vauvenal5/yaga-docs/pull/1