Commit Graph

3 Commits

Author SHA1 Message Date
Nik Clayton 0d5d118267
refactor: Move AccountManager to core.data.repository (#976) 2024-10-03 21:28:01 +02:00
Nik Clayton 90537da122
feat: Add option to download media to per-sender directories (#954)
Update `DownloadUrlUseCase` with a parameter to specify the account that
"owns" the media. This is either the account that posted the status, or
the account being viewed (e.g., if downloading an account's header
image).

Add a new `DownloadLocation` enum constant to download to directories
named after that account.

Pass this information through at the call sites.

Fixes #938
2024-09-27 11:29:34 +02:00
Nik Clayton 85ab714ec1
feat: Add option to save attachments to per-account folders (#945)
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
2024-09-26 13:51:30 +02:00