Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add option to save attachments to per-account folders #945

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

nikclayton
Copy link
Contributor

The existing code downloaded any attachments to the user's "Downloads" folder. If the user is logged in with several accounts these downloads will be mixed up together.

Fix this by adding a new preference that allows the user to specify the downloads should be placed in a sub-folder per account, named after the account.

To do this:

  • Add an interface for enums that can be used as preferences, with properties for the string resource to display and the value to store.
  • Add EnumListPreference, a ListPreference that allows the user to choose between different enum values.
  • Add a DownloadLocation enum and preference key so the user can choose the location.
  • Add a core.domain module, with a use case for downloading URLs that respect's the user's download preference. Use this use-case everywhere that files are currently downloaded.

Fixes #938

The existing code downloaded any attachments to the user's "Downloads"
folder. If the user is logged in with several accounts these downloads
will be mixed up together.

Fix this by adding a new preference that allows the user to specify
the downloads should be placed in a sub-folder per account, named
after the account.

To do this:

- Add an interface for enums that can be used as preferences, with
  properties for the string resource to display and the value to store.
- Add `EnumListPreference`, a `ListPreference` that allows the user to
  choose between different enum values.
- Add a `DownloadLocation` enum and preference key so the user can
  choose the location.
- Add a `core.domain` module, with a use case for downloading URLs
  that respect's the user's download preference. Use this use-case
  everywhere that files are currently downloaded.

Fixes #938
@nikclayton nikclayton merged commit 85ab714 into main Sep 26, 2024
23 checks passed
@nikclayton nikclayton deleted the 938-download-location branch September 26, 2024 11:51
@bee8bit
Copy link

bee8bit commented Sep 26, 2024

Aahhh, wait!

If the user is logged in with several accounts these downloads will be mixed up together.

As I had described in the request #938 (comment) I need to sort downloads by the senders' accounts, not by my own ones (I do only have one).
Perhaps this is useful for somebody else. So, do you think a third option for this pref would be feasible?

Thanks so much.

@nikclayton
Copy link
Contributor Author

Oh, my bad. Third option coming up in #954

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.

Save attachments to individual folders
2 participants