owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.81k stars 3.05k forks source link

choose multi folder for auto upload #2396

Open dassio opened 5 years ago

dassio commented 5 years ago

Actual behaviour

-choose auto upload source, currently only the camra folder will be selected

Steps to reproduce

  1. enable auto upload
  2. choose auto upload folder

Can this problem be reproduced with the official owncloud server? (url: https://demo.owncloud.org, user: test, password: test) Yes

Environment data

Android version: 8.1.0 Device model: Huawei Mate 10 Stock or customized system: Stock ownCloud app version: 2.9.3 ownCloud server version: 10.0

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here
jesmrec commented 5 years ago

thanks for sharing your idea!

ghost commented 5 years ago

I will implement it.

jesmrec commented 5 years ago

One thing: currently, you can select the source folder for your camera uploads. If you install a different camera (not the built-in one), you can also select the folder of such camera as source.

You wrote:

it should be able to choose more than one folder for auto upload

my question is... at the same time?

Please, clarify a bit the scope of the issue

jonas740 commented 5 years ago

I recently discovered this problem.

When I got my new phone the photos are saved in one folder and my videos in a seperate one.

In owncloud you can only select one of theese folders as source.

opfeifer commented 5 years ago

I would like to add that I have have sub-folders for each camera app inside the DCIM folder, on the phone as well as on the SD card. However, I cannot even select a folder outside of the standard path, since all folders above seem to be empty if I browse them, and I cannot edit the path otherwise.

jonas740 commented 5 years ago

So, is this feature added yet to the application ? Only seen a beta 2.10 version release but dont know if this feature is added into that one. Should not be very hard to implement this feature.

jesmrec commented 5 years ago

@jonas740 the feature is not implemented yet

davigonz commented 5 years ago

So, is this feature added yet to the application ? Only seen a beta 2.10 version release but dont know if this feature is added into that one. Should not be very hard to implement this feature.

If you know how to implement this, maybe you could send us a contribution, we will really appreciate it! 😉

jonas740 commented 5 years ago

@davigonz ye, send me the code and ill do it. Since there already is one entry for choosing a folder. It should not be anything more then to "copy/paste" that and tweak it just a little bit.

But I think you could manage that yourself.

Its not like you have to invent the wheel all over again. ;)

butonic commented 5 years ago

While we used the file observer to monitor new pictures inside a folder I think this was the wrong approach. We now face the problem presented in this issue. If we allow adding multiple folders that will alienate end users, because they have to manually add a path whenever an app decides to store media in a different folder.

The JobInfo.Builder.html#addTriggerContentUri(android.app.job.JobInfo.TriggerContentUri) should be the right thing to use. probably not limited to just the DCIM_DIR but also paths that include well known apps like whatsapp and facebook. we should add that in code ... if need be add an option to add custom apps.

davigonz commented 5 years ago

Thanks @butonic for your comment

While we used the file observer to monitor new pictures inside a folder I think this was the wrong approach.

We are no longer using file observer from one year ago, when we replaced Instant uploads feature with Camera uploads one and decided to use JobService.

The current implementation consists basically of a CameraUploadsHandler and a CameraUploadsSyncJobService which looks the camera folder set by the user for new pictures or videos every 15 minutes at least. Android system itself is the responsible for launching this job in background, taking into account the resources used by the system in every moment.

This is the way to proceed from now on since most recent Android versions will kill the tasks trying to be always active.

The JobInfo.Builder.html#addTriggerContentUri(android.app.job.JobInfo.TriggerContentUri) should be the right thing to use.

Why was not addTriggerContentUri an option for us? Because it was added in API 24 so it would work just on Android 7+ devices while the current implementation is supported from Android 5.

We could try to improve our current Jobs implementation by using that option but many of our users (<Android7) will not be able to use it, unless we include both implementations, which would add extra complexity, difficult to handle in my opinion.

Besides, there's some limitations such as trigger URIs can not be used in combination with setPeriodic(long) or setPersisted(boolean) but should not be a blocker and could be easily overcome:

Any suggestion is welcome

ddellarocca commented 3 years ago

Hi, I think that could be useful to set custom folder backup to enable app backups, for example whatsapp which saves a local backup in its folder, in this way i can upload automatically to my owncloud server my chat backups.

jesmrec commented 2 years ago

@ddellarocca yes, that feature is addressed in the following issue: https://github.com/owncloud/android/issues/3126

joneldiablo commented 2 years ago

HI!!!! What is the current status of this feature? XD

jesmrec commented 2 years ago

Neither done nor forgotten. Team is busy with re-architecture.