Skip to content

Conversation

@PhilippThaler
Copy link

Feature: Add Subfolder Strategy for Automatic Uploads

Based on #46

What does this PR do?

This PR introduces a new feature that allows users to automatically organize their camera uploads into subfolders based on the date the picture or video was taken. Users can choose to create subfolders by:

  • Year (/2025/)
  • Year and Month (/2025/11/)
  • Year, Month, and Day (/2025/11/09/)

This helps users keep their cloud storage tidy and makes it easier to browse through photos from specific dates.

How is this implemented?

  • Added UseSubfoldersBehaviour Enum:
    • A new enum was added to FolderBackUpConfiguration.kt to represent the different subfolder options (NONE, YEAR, YEAR_MONTH, YEAR_MONTH_DAY).
  • Updated AutomaticUploadsWorker:
    • Create the function buildUploadPath to construct the remote path dynamically based on the selected UseSubfoldersBehaviour and the file's last modified date.
  • Database and Migrations:
    • The FolderBackUpEntity and the corresponding database migration (MIGRATION_43_44) were updated to include the new useSubfoldersBehaviour field.

How to test this?

  1. Navigate to Settings > Automatic Uploads for either pictures or videos.
  2. Select a new option under the "Upload to Subfolders" preference.
  3. Add a new image/video to the source folder on your device.
  4. Wait for the automatic upload worker to run (or trigger it manually).
  5. Verify that the file is uploaded to the correct subfolder in your cloud account.
  6. Repeat for all subfolder options.

Screenshots

Screenshot_2025-11-09-23-34-29-553_eu opencloud android debug_1
Screenshot_2025-11-09-23-34-41-512_eu opencloud android debug_1

@PhilippThaler PhilippThaler force-pushed the feature/upload-subfolders-by-date branch 2 times, most recently from 426682e to 58a9e8a Compare November 9, 2025 22:51
@PhilippThaler PhilippThaler force-pushed the feature/upload-subfolders-by-date branch from 58a9e8a to fd65b96 Compare November 9, 2025 22:53
@PhilippThaler PhilippThaler marked this pull request as ready for review November 9, 2025 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant