Skip to content

Refactoring Auto-Upload logic to support generic folders and file types #124

Open

Description

@PhilippThaler

While working on #56, I observed significant logic duplication between the photo and video upload modules. Currently, SettingsPictureUploadFragment and SettingsVideoUploadFragment (and their respective ViewModels) are nearly identical. This hardcoded approach makes maintenance difficult and prevents us from supporting multiple media folders or custom file syncs.

Proposed Solution
I propose refactoring the auto-upload architecture from "Type-Based" (Photo vs. Video) to "Configuration-Based" (Folder A, Folder B, Folder C).

Generic Logic: Create a unified AutoUploadViewModel and background worker that accepts parameters (folder path, MIME type filters, destination rules).

Unified UI: Consolidate the fragments into a single AutoUploadFragment.

Nextcloud-style UX: Use a list view that automatically detects standard media folders (DCIM, WhatsApp, etc.) and allows users to toggle them or add custom folders via a file picker.

There are multiple issues open that would benefit from that refactor like:
#59 #47 #25

I'm interested in working on this and would love to hear your thoughts on the proposed architecture before I start.

What do you think?

Activity

  1. PhilippThaler commented on Apr 12, 2026

    @PhilippThaler
    Author

    And also, I think it makes sense to treat the refactor itself as its own seperate issue first without touching the UI. That creates a clean foundation for future tasks. What do you think?

  2. eduardohki commented on Jun 8, 2026

    @eduardohki

    Thanks for the work on this! This is my last blocker preventing me from finally migrating off that mess that Nextcloud is 🥲

  3. bilogic commented on Aug 14, 2026

    @bilogic

    Yes, thanks for the work, it's flabbergasting how nextcloud is rated so highly by so many

    @PhilippThaler can I ask, how many folders does this unified auto upload support? Still 2? Or "unlimited"? I have screenshots that needs to be moved off my device too thanks!

    And for a moment, I got confused between own/opencloud, see owncloud/android#3867 (comment)

  4. bilogic commented on Aug 14, 2026

    @bilogic

    @PhilippThaler

    for discussion's sake, how should auto upload treat files that already exists on the device when auto upload is setup, because 3 of my files in the camera folder are not move to the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions