Skip to content

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

@PhilippThaler

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?

Metadata

Metadata

Assignees

No one assigned

    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