diff --git a/lib/use_case/add_to_album.dart b/lib/use_case/add_to_album.dart index adf83e7e..5392b524 100644 --- a/lib/use_case/add_to_album.dart +++ b/lib/use_case/add_to_album.dart @@ -52,7 +52,7 @@ class AddToAlbum { ); await UpdateAlbum(albumRepo)(account, newAlbum); - if (pref.isLabEnableSharedAlbumOr(false)) { + if (album.shares?.isNotEmpty == true) { final newFiles = items.whereType().map((e) => e.file).toList(); if (newFiles.isNotEmpty) { @@ -65,9 +65,6 @@ class AddToAlbum { Future _shareFiles( Account account, Album album, List files) async { - if (album.shares?.isNotEmpty != true) { - return; - } final albumShares = (album.shares!.map((e) => e.userId).toList() ..add(album.albumFile!.ownerId ?? account.username)) .where((element) => element != account.username) diff --git a/lib/use_case/remove_album.dart b/lib/use_case/remove_album.dart index b43d4f55..0f2d45f6 100644 --- a/lib/use_case/remove_album.dart +++ b/lib/use_case/remove_album.dart @@ -19,7 +19,7 @@ class RemoveAlbum { /// Remove an album Future call(Account account, Album album) async { _log.info("[call] Remove album: $album"); - if (pref.isLabEnableSharedAlbumOr(false)) { + if (album.shares?.isNotEmpty == true) { // remove shares from the album json. This should be the first so if this // fail the whole op can fail safely await UpdateAlbum(albumRepo)( @@ -39,8 +39,7 @@ class RemoveAlbum { } Future _unshareFiles(Account account, Album album) async { - if (album.shares?.isNotEmpty != true || - album.provider is! AlbumStaticProvider) { + if (album.provider is! AlbumStaticProvider) { return; } final albumShares = (album.shares!.map((e) => e.userId).toList() diff --git a/lib/use_case/remove_from_album.dart b/lib/use_case/remove_from_album.dart index 0dab84fc..67184b7a 100644 --- a/lib/use_case/remove_from_album.dart +++ b/lib/use_case/remove_from_album.dart @@ -38,7 +38,7 @@ class RemoveFromAlbum { newAlbum = await _fixAlbumPostRemove(account, newAlbum, items); await UpdateAlbum(albumRepo)(account, newAlbum); - if (pref.isLabEnableSharedAlbumOr(false)) { + if (album.shares?.isNotEmpty == true) { final removeFiles = items.whereType().map((e) => e.file).toList(); if (removeFiles.isNotEmpty) { @@ -89,9 +89,6 @@ class RemoveFromAlbum { Future _unshareFiles( Account account, Album album, List files) async { - if (album.shares?.isNotEmpty != true) { - return; - } final albumShares = (album.shares!.map((e) => e.userId).toList() ..add(album.albumFile!.ownerId ?? account.username)) .where((element) => element != account.username)