phpbg / easysync

Synchronize your android phone/tablet with your DAV server, the easy way.
MIT License
106 stars 6 forks source link

Exclude subpaths when parent path is clicked #45

Closed benabel closed 1 week ago

benabel commented 3 weeks ago

Hi @phpbg and thanks for sharing this app as oss. I open this PR for to enable or disable all subpath under a parentPath when clicked in the advanced settings page.

benabel commented 3 weeks ago

It also would be better to hide those subpath when parent is disabled. Are you OK with this UX change?

phpbg commented 3 weeks ago

Hi, thanks for your PR. It looks good, but we have to discuss if this is necessary.

Say you have following folders:

Excluding DCIM will only exclude files that are direct children of DCIM. DCIM/foo will be synced unless you explicitely disable it too.

Your PR will disable automatically DCIM/foo if you disable DCIM. This may be interesting, but maybe it is not what the user expects.

At least we must not hide subfolders and let user decide.

This behaviour can be seen here: https://github.com/phpbg/easysync/blob/e0109c07102bec7fe53c23a13a7bf863c58ff7a0/app/src/main/java/com/phpbg/easysync/mediastore/MediaStoreService.kt#L71

We do not filter if file path starts with an excluded folder, we filter if file path match exactly with an excluded folder.

What do you think?

benabel commented 2 weeks ago

Hi @phpbg ,

that is exactly the desired behavior and I think this a better UX than previous one.

In fact, I have Music Folder in which my audios are classified like this: Music/artist/album/audios.mp3 with about 100 artists and many albums per artist. Previously it was almost impossible to disable syncing Music (more than hundred clicks needed!) now you can easily select which folders can be synced.

Nextcloud client app propose a similar approach that seems appropriate, they also have a sort of hierarchy in the ui to show the file structure and allowing folders handling.

Also hiding sub folders would be handy, when you have a lot of subfolders like me it is a lot clearer. Also here maybe the hierarchy ui could be a win instead of just hiding.

benabel commented 2 weeks ago

Nice catch. I've included your change and rebased my repo if you want to include it.

phpbg commented 1 week ago

It looks good, I do a few more tests then I'll merge it and make a release.