-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: opt-in sync of deletes and restores from web to Android #16732
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
Merged
alextran1502
merged 30 commits into
immich-app:main
from
aleksandrsovtan:mobile/manage_local_media_files
Apr 8, 2025
Merged
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2d24c9e
Features: Local file movement to trash and restoration back to the al…
aleksandrsovtan 18d9d63
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 905e8fb
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan b65b88d
Comments fixes
aleksandrsovtan 386f767
settings button marked as [EXPERIMENTAL]
aleksandrsovtan 2616587
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 638785c
_moveToTrashMatchedAssets refactored, moveToTrash renamed.
aleksandrsovtan bc5fa20
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 084aa53
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan d083649
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan ddd7eae
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 94104cf
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan b907e36
Merge branch 'main' into mobile/manage_local_media_files
alextran1502 68ed09d
fix: bad merge
alextran1502 5802822
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 8039f9f
Permission check and request for local storage added.
aleksandrsovtan aafe29d
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan c29004c
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan dbbdfce
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 41afc84
Permission request added on settings switcher
aleksandrsovtan f12d211
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan fca7a32
Settings button logic changed
aleksandrsovtan 91eb052
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 7719d39
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 6973b0e
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 789d173
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 5ec71c9
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan 2e71c85
Method channel file_trash moved to BackgroundServicePlugin
aleksandrsovtan efdbd6b
Merge branch 'main' into mobile/manage_local_media_files
aleksandrsovtan eceb586
Merge branch 'main' into mobile/manage_local_media_files
alextran1502 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
abstract interface class ILocalFilesManager { | ||
Future<bool> moveToTrash(String fileName); | ||
Future<bool> restoreFromTrash(String fileName); | ||
Future<bool> requestManageStoragePermission(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
mobile/lib/repositories/local_files_manager.repository.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
import 'package:immich_mobile/interfaces/local_files_manager.interface.dart'; | ||
import 'package:immich_mobile/utils/local_files_manager.dart'; | ||
|
||
final localFilesManagerRepositoryProvider = | ||
Provider((ref) => LocalFilesManagerRepository()); | ||
|
||
class LocalFilesManagerRepository implements ILocalFilesManager { | ||
@override | ||
Future<bool> moveToTrash(String fileName) async { | ||
return await LocalFilesManager.moveToTrash(fileName); | ||
} | ||
|
||
@override | ||
Future<bool> restoreFromTrash(String fileName) async { | ||
return await LocalFilesManager.restoreFromTrash(fileName); | ||
} | ||
|
||
@override | ||
Future<bool> requestManageStoragePermission() async { | ||
return await LocalFilesManager.requestManageStoragePermission(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you re-use the existing method channel in
BackgroundServicePlugin
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aleksandrsovtan Can you resolve this comment to proceed with the review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aleksandrsovtan, Can you help resolve this comment, moving the code to
BackgroundServicePlugin
so that we have better separation? I think after this resolved, we can emerge the PR. I just tested again and everything looks goodThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a challenge, since the background service plugin doesn't have an activity. I'll try to do it ASAP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shenlong-tanwen Done!