mirror of
https://github.com/immich-app/immich.git
synced 2026-03-10 20:28:04 +03:00
fix(mobile): 14983 Images upload to shared album with common name (#15127)
* Initial look at fixing issue where images are uploaded to the wrong album if a shared album conflicts with a local users album. * Use owner instead of shared flag when fetching albums. * Fix issue with refreshRemoteAlbums getting shared items twice and removed incorrect isShared comment. Using `getAll(shared: true)` gets all shared albums the user can access (regardless of owner, despite the previous comment). Using `getAll(shared: null)` gets all albums (incuding shared = true and shared = false). I presume the intent here was to get albums that were shared (and not mine), and not shared (ie: mine), but the logic is way off. It also just then combines them - so makes more sense to just get them in a single call. * Fix formatting. * Fixed tests. * Revert "Fixed tests." This reverts commitc38f5af5ac. * Revert "Fix issue with refreshRemoteAlbums getting shared items twice and removed incorrect isShared comment." This reverts commit979ce90abf. * Added comments to explain why filters behave the way they do for getAll() albums. --------- Co-authored-by: Tom graham <tomg@questps.com.au> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -46,8 +46,18 @@ class AlbumNotifier extends StateNotifier<List<Album>> {
|
||||
) =>
|
||||
_albumService.createAlbum(albumTitle, assets, []);
|
||||
|
||||
Future<Album?> getAlbumByName(String albumName, {bool remoteOnly = false}) =>
|
||||
_albumService.getAlbumByName(albumName, remoteOnly);
|
||||
Future<Album?> getAlbumByName(
|
||||
String albumName, {
|
||||
bool? remote,
|
||||
bool? shared,
|
||||
bool? owner,
|
||||
}) =>
|
||||
_albumService.getAlbumByName(
|
||||
albumName,
|
||||
remote: remote,
|
||||
shared: shared,
|
||||
owner: owner,
|
||||
);
|
||||
|
||||
/// Create an album on the server with the same name as the selected album for backup
|
||||
/// First this will check if the album already exists on the server with name
|
||||
@@ -55,7 +65,7 @@ class AlbumNotifier extends StateNotifier<List<Album>> {
|
||||
Future<void> createSyncAlbum(
|
||||
String albumName,
|
||||
) async {
|
||||
final album = await getAlbumByName(albumName, remoteOnly: true);
|
||||
final album = await getAlbumByName(albumName, remote: true, owner: true);
|
||||
if (album != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user